1. Create an ADO connection to the SQL Server database.
2. Create an ADO Command object
a. Point the ADO command object at the ADO connection
b. Set the type of ADO command object to stored proc
c. Set the stored proc name of the command object to the name of stored proc
d. Set the parameters of the command object
3. Execute the ADO command object
As in:
Set adoConn = New ADODB.Connection
adoConn.open "parameters to open db here"
Set adoCmd = New ADODB.Command
adoCmd.ActiveConnection = adoConn
adoCmd.CommandType = adCmdStoredProc
adoCmd.CommandText = "sp_mystoredproc"
set adoParam = New ADODB.Parameter
adoParam.Direction = adParamInput
adoParam.Value = "value of param to pass"
adoCmd.Parameters.Append adoParam
... (more params as necessary)
adoCmd.Execute
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.