-
Execute
HI All:
I have a stored procedure on mys sqlserver. The name of the sp is deletedata. How can I execute this sp from vb and pass it the record id? In vfp I use to execute the sp by using the following code:
sqlcmd = 'EXECUTE[CLEAR_EDIFILE] ' + ALLTRIM(edifile)
jtq = SQLEXEC(cn, sqlcmd)
Need to do the same in vb.
Thanks
-
I hope that following will help you with executing your procedure.
Dim adoConn As New ADODB.Connection
adoConn.Open sConnect
Dim adoSPw As New ADODB.Command
adoSPw.ActiveConnection = adoConn
adoSPw.CommandText = "own_procedure"
adoSPw.CommandType = adCmdStoredProc
adoSPw.Parameters(1).Value = input_value
adoSPw.Execute
outPut_value = adoSPw.Parameters(2).Value
-
You may want to try posting a link to this thread in the
Databases or Classic VB forums. This forum is just for VBA.
:)
-
resolved