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?