Open multiple recordsets using single parameterized command object 
Author Message
 Open multiple recordsets using single parameterized command object

Hi,

I think I'm missing something.  I am trying to use a parameterized command
object in VB6 to open multiple recordsets, each the result of a query based
on a different parameter.  Here is a very simplified version of what I'm
doing:

   DE.RunQuery  myparameter
   set rs1 = DE.rsRunQuery
   ....
   ....
   ....
   DE.RunQuery  differentparameter
   set rs2 = DE.rsRunQuery

where DE is an instance of a DataEnvironment and RunQuery is my Command
object.  The problem is that when I try to run the second query using my
second parameter, I get an error saying that I'm not allowed to do that
while it's in the open state.

The goal I'm trying to achieve is to use the data in each recordset to
populate a different instance of an MDI child form, but I don't want to
create multiple command objects if I don't have to.  I figured a
parameterized command object was the way to go since the queries are
basically the same aside from the single parameter.  However, I'm running
into the troubles described above.

Could someone please point me in the right direction or perhaps suggest a
better way to do what I'm trying to do?

Thanks,

Jordan



Tue, 11 Feb 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ADO, Oracle, MTS, using command object to open Recordset

2. Batch update for multiple tables using single ADO Recordset (VB )

3. Batch update for multiple tables using single ADO Recordset (VB )

4. ADO Command Object using Multiple Connection Objects

5. Opening multiple .mdb files using a single connection

6. Module-level multiple-record recordset vs temp single-record recordset

7. Filtering Single recordset vs creating multiple recordsets

8. Module-level multiple-record recordset vs temp single-record recordset

9. Recordset.open with Command object

10. opening recordset without Command Object

11. Parameterized SQL statements with ADO.Command object

12. Update a recordset using a command object

 

 
Powered by phpBB® Forum Software