1. The simplest one is as follows
DimobjConn
SetobjConn=Server.CreateObject("ADOBD.Connection")
objConn.OpenApplication("Connection_String")
'Callthestoredproceduretoincrementacounteronthepage
objConn.Execute"execsp_AddHit"
No parameters, no return, no error handling, that's it
2. A call with parameters
objConn.Execute"execsp_AddHit,'http://www.asp001.net',1"
Please note that the split parameters are not returned to records.
3. Return to the record
DimobjConn
DimobjRs
SetobjConn=Server.CreateObject("ADOBD.Connection")
SetobjRs=Server.CreateObject("ADOBD.Recordset")
objConn.OpenApplication("Connection_String")
'Callthestoredproceduretoincrementacounteronthepage
objRs.OpenobjConn,"execsp_ListArticles'1/15/2001'"
'Loopthroughrecordsetanddisplayeacharticle
4....
DimobjConn
DimobjCmd
'Instantiateobjects
SetobjConn=Server.CreateObject("ADODB.Connection")
setobjCmd=Server.CreateObject("ADODB.Command")
conn.OpenApplication("ConnectionString")
WithobjCmd
.ActiveConnection=conn'Youcanalsojustspecifyaconnectionstringhe
.CommandText="sp_InsertArticle"
.CommandType=adCmdStoredProc'Requirestheadovbs.incfileortypelibmetatag
'AddInputParameters
.Parameters.Append.CreateParameter("@columnist_id",adDouble,adParamInput,,columnist_id)
.Parameters.Append.CreateParameter("@url",adVarChar,adParamInput,255,url)
.Parameters.Append.CreateParameter("@title",adVarChar,adParamInput,99,url)