Just use a recordset object as you normally would. i.e. say your SP has a name of MySP and it accepts one parameter. So you query string would be something like...
MyQueryString = "MySp " & MyValue
Then execute the query as you normally would.
Good Luck
vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
Correct me if I am wrong maheshsayani or anyone else, but using a command object used that way will not return a recorset....
>need a small help can anyone help me in showing how to call a stored procedure which returns a recordset
Hence, my suggestion to use a recordset object...
vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
I am sure you know that the result of command.execute is record set. so may be explain your question more?
Yes, I do realize that if you...
Set recordset = command.Execute( RecordsAffected, Parameters, Options )
but the way maheshsayani used it...
command.Execute RecordsAffected, Parameters, Options
does not return a recordset, hence my post...
As for understanding the OP's origional Q see post #1 above. It seems pretty strait forward to me...
Good Luck
vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
Hi Sameer,
If you are using VB6 then u need to use Command object.
Please see the below example
Dim mobjConn As ADODB.Connection
Dim mobjCmd As ADODB.Command
Dim mobjRst As ADODB.Recordset
Set mobjCmd = New ADODB.Command
mobjCmd.CommandType = adCmdStoredProc
mobjCmd.Parameters.Append mobjCmd.CreateParameter(" ", , , ,)
mobjCmd.CommandText = strSPName
mobjCmd.Execute
Please let me know if you have any issues
Mahesh B Sayani
Hi,
Sorry if im too late.
But please can you explain, what is "strSPName" and will the "mobjCmd" return a resultset. If yes, then how must the resultset be handled if needed?
Thank you.
RahulV
Junior Poster in Training
92 posts since Jun 2007
Reputation Points: 26
Solved Threads: 0