Multiple recordsets for a single ADO connection??? 
Author Message
 Multiple recordsets for a single ADO connection???

Hi,

Is it possible to have more than one recordset open for a single ADO
connection?

If so, are there any restrictions that I need to consider (cursor
types, etc)??

Hopefully somebody can help me out here.

Thanks,
 - Mark



Tue, 15 Apr 2003 19:01:01 GMT  
 Multiple recordsets for a single ADO connection???
Definitely!  This exact behaviour is demonstrated in the data designer.  The
same applies when creating recordsets programatically.  Curser types will
depend on the type of recordset and database you are attaching to.

Good Luck,
-Kurt


Quote:
> Hi,

> Is it possible to have more than one recordset open for a single ADO
> connection?

> If so, are there any restrictions that I need to consider (cursor
> types, etc)??

> Hopefully somebody can help me out here.

> Thanks,
>  - Mark



Tue, 15 Apr 2003 20:27:35 GMT  
 Multiple recordsets for a single ADO connection???
Hi, Mark:

Once you have established a connection, you can open multiple
recordsets using the connection

Dim oCon As ADODB.Connection
Dim oRs1 As ADODB.Recordset
Dim oRs2 As ADODB.Recordset
Dim ConnStr As String

Set oCon = New ADODB.Connection
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=" & _
                 "d:\MyDataBase.mdb;"

oCon.Open ConnStr

Set oRs1 = New ADODB.Recordset
oRs1.Open "SELECT * FROM Customers WHERE LastName LIKE 'A%'", oCon, adOpenStatic, _
    adLockReadOnly, adCmdText

Set oRs2 = New ADODB.Recordset
oRs2.Open "SELECT * FROM Customers WHERE LastName LIKE 'Z%'", oCon, adOpenStatic, _
    adLockOptimistic, adCmdText

1 connection, 2 recordsets and 2 different lock types (read-only/lock optimistic)
Choose the cursor and lock type depending on what you want to do with the
recordset.

Cheers,
-Toby

Quote:
>Is it possible to have more than one recordset open for a single ADO
>connection?



Tue, 15 Apr 2003 21:36:25 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Multiple Recordsets for a single ADO connection???

2. Problem with multiple RecordSets from a single ADODB.Connection

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

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

5. max recordsets using a single ado 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. Opening multiple .mdb files using a single connection

10. SQL - multiple recordsets and a single table questions

11. 3251 Current provider doesn't support returning multiple recordsets from a single execution

12. Current provider does not support returning multiple recordsets from a single execution

 

 
Powered by phpBB® Forum Software