Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures 
Author Message
 Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures

I am connecting to a SQL Server 7.0 database. Using VB6 SP3 I am trying
to execute a parameterized query against a stored procedure on SQL
Server. I need to pass in a few variables and get back a keyset or
dynamic recordset. I was trying to use command execute but I only get
back forward only recordsets. Anybody know of a way to either convert
forward only to keyset/dynamic or return the keyset/dynamic recordset
directly?

Thanks

Sanju



Fri, 26 Jul 2002 03:00:00 GMT  
 Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures


Quote:
>I am connecting to a SQL Server 7.0 database. Using VB6 SP3 I am trying
>to execute a parameterized query against a stored procedure on SQL
>Server. I need to pass in a few variables and get back a keyset or
>dynamic recordset. I was trying to use command execute but I only get
>back forward only recordsets. Anybody know of a way to either convert
>forward only to keyset/dynamic or return the keyset/dynamic recordset
>directly?

>Thanks

>Sanju

You need to use the recordset object to open the cursor:

set cmd.activeconnection=conn
cmd.commandtext = "sp_YadaYada"
cmd.commandtype = adCmdStoredProc
cmd.parameters.refresh


rs.open cmd,,adOpenDynamic,adLockOptimistic

Dan Bush
Battle Ground.wa.us
Please No Spam, to email, change .com to .net



Fri, 26 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures

2. Returning keyset/dynamic recordsets when executing parameterized queries against Stored Procedures

3. Creating disconected recordsets against a parameterized stored procedures

4. Execute parameterized query stored in ACCESS-2 DB thru VBA

5. Execute Parameterized Query in Access and Export to Excel

6. Executing Parameterized Queries in a DTC

7. execute a parameterized query in SQLServer

8. No data returned using Access parameterized query and ADO

9. Opening an ADO recordset against a dataset returned from a SQL Server Stored Procedure

10. recordset from a parameterized query

11. recordsets in parameterized queries

12. Query against disconnected recordset

 

 
Powered by phpBB® Forum Software