<script LANGUAGE="VBScript" RUNAT="Server"> Function FUNCTION_NAME() Dim Cmd Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = Application("SQL_DSN") Cmd.CommandText = "SQL_GOES_HERE" Cmd.CommandType = adCmdText Set FUNCTION_NAME = Cmd.Execute End Function Function FUNCTION_NAME_STORED_PROC(ITEM1,ITEM2,ITEM3, ITEM4) Dim Param, Cmd Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = Application("SQL_DSN") Cmd.CommandText = "STORED_PROC_NAME_GOES_HERE" Cmd.CommandType = adCmdStoredProc Set Param = Cmd.CreateParameter("@strVarName1", adBoolean, adParamInput, 1, ITEM1) 'Bit Cmd.Parameters.Append Param Set Param = Cmd.CreateParameter("@strVarName2", adInteger, adParamInput, 4, ITEM2) 'Integer Cmd.Parameters.Append Param Set Param = Cmd.CreateParameter("@strVarName3", adVarChar, adParamInput, 255, ITEM3) 'STRING - VarChar Cmd.Parameters.Append Param Set Param = Cmd.CreateParameter("@strVarName4", adLongVarChar, adParamInput, len(ITEM4), ITEM4) 'TEXT/IMAGE Data Type Cmd.Parameters.Append Param Set FUNCTION_NAME_STORED_PROC = Cmd.Execute End Function Function FUNCTION_NAME_CURSORS(page,pagesize) Dim cnn, rs Set cnn = Server.CreateObject("ADODB.Connection") cnn.Open Application("SQL_DSN") Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorType = adOpenStatic rs.PageSize = pagesize rs.Open "SQL_GOES_HERE",Application("SQL_DSN"),1,2 rs.AbsolutePage = page Set FUNCTION_NAME_CURSORS = rs End Function '-------Here's some great functions for a simple connection to the database, to execute an SQL command, or to convert an HTML page to an .asp string. Function Connect()'-----'Connect' acts as object, - Connect.Execute(SQL) Dim cnn Set cnn = Server.CreateObject("ADODB.Connection") cnn.Open DSN Set Connect = cnn End Function Function CommandSQL(sSQL) '------------- EX.: Set rs = CommandSQL("SELECT * from table") Dim Cmd Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = DSN Cmd.CommandType = adCmdText '2 Cmd.CommandText = sSQL Set CommandSQL = Cmd.Execute End Function Function HTMLToASP(s) ' This converts an HTML page to an .asp string. Dim ss ss = s ss = Replace(ss,"<" & "%","&lt;%") ss = Replace(ss,"%" & ">","%&gt;") ss = Replace(ss,"""","""""") ss = Replace(ss,"<","&lt;") ss = Replace(ss,">","&gt;") ss = Replace(ss,vbcrlf,"&quot;" & "&_" & vbcrlf & vbtab & "&quot;") ss = vbtab & "&quot;" & ss & "&quot;" & vbcrlf HTMLToASP = ss End Function </script>