Dim cnn As new ADODB.Connection
Dim cmd As new ADODB.Command
cnn.Open "Provider=SQLOLEDB;………………"
Set cmd.ActiveConnection=cnn
cmd.CommandType=4
cmd.CommandText="sp_name"
cmd.Parameters.Refresh
cmd("Para1")=val1
cmd("Para2")=val2
cmd.Execute
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "data source name", "userid", "password"
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = cn
' Define the stored procedure's inputs and outputs
' Question marks act as placeholders for each parameter for the
' stored procedure
cmd.CommandText = "{?=call sp_test(?)}"
' specify parameter info 1 by 1 in the order of the question marks
' specified when we defined the stored procedure
cmd.Parameters.Append cmd.CreateParameter("RetVal", adInteger, _
adParamReturnValue)
cmd.Parameters.Append cmd.CreateParameter("Param1", adInteger, _
adParamInput)
cmd.Parameters("Param1") = 33
cmd.Execute