Hello, I get a applicaction in VB6, my DB in SQLServer 2000, I need to execute a store procedure in the Server, it returns parameters output, how can I get those parameters in my app VB?
Below is the code I use to pass parameters to a stored procedure and get the resulting recordset.
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
With cmd
.ActiveConnection = m_Conn 'defined and set at form level.
.CommandText = "StoredProcedureName"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("Param", adInteger, adParamInput)
.Parameters("Param".Value = <variable>
End With
rs.Open cmd, , adOpenStatic, adLockOptimistic
"StoredProcedureName" is the name of my stored procedure.
"Param" is the name of my parameter in the stored procedure (@Param). Add as many parameters as you require in the same order as they appear in the stored procedure.
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.