Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset returned from Stored Proc has no recordcount

Status
Not open for further replies.

taranis

Programmer
Jan 31, 2001
20
0
0
US
I am running a stored proc that is returning a recordset. I want to send the recordset to a grid. The problem is that the recordset gets returned as a dynamic cursor with recordset property set to -1. I want to return the rs as readonly static so that I can set the grid recordset property to the returned recordset. This will not work. The grid works fine with other recordset obtained by SQL so it is not a grid problem.

I am running SQL 6.5/SP5a and VB6 /SP4
Code Follows:

Function RunStoredProc(sSQL As String, Optional bTest As Boolean = True) As adoDB.Recordset
Dim vntParams() As String
Dim sDataConnect As String
Dim adoDB As adoDB.Connection
Dim rs As adoDB.Recordset
Dim adoCommand As New adoDB.Command
Set adoCommand.ActiveConnection = g_adoDB
adoCommand.CommandType = adCmdStoredProc
adoCommand.CommandText = "sp_jhsTest "
Set rs = adoCommand.Execute
Set RunStoredProc = rs

End Function

 
I am not sure you wanna do that. Normally stored procedures are for DM..like updating/inserting stuff.
Is there any specific reason you are doing that ?
 
NEVER MIND, The problem was simple I forgot to set the connection to use a client side cursor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top