Opening DAO Recordsets


P

Pat Randall

What is the most efficient way to open multiple DAO recordsets residing
in the same database (Access 2000)
Do you have to declare separate Database objects for each recordset or
can you use just one?
Example Option 1:
Dim db as Database
Dim rs1 as Recordset
Dim rs2 as Recordset
Dim rs3 as Recordset
Set db = CurrentDB
Set rs1 = db.OpenRecordset("SampleName1", DBOpenDynaset)
Set rs2 = db.OpenRecordset("SampleName2", DBOpenDynaset)
Set rs3 = db.OpenRecordset("SampleName3", DBOpenDynaset)

-or-

Example Option 2:
Dim db1 as Database
Dim db2 as Database
Dim db3 as Database
Dim rs1 as Recordset
Dim rs2 as Recordset
Dim rs3 as Recordset
Set db1 = CurrentDB
Set db2 = CurrentDB
Set db3 = CurrentDB
Set rs1 = db1.OpenRecordset("SampleName1", DBOpenDynaset)
Set rs2 = db2.OpenRecordset("SampleName2", DBOpenDynaset)
Set rs3 = db3.OpenRecordset("SampleName3", DBOpenDynaset)

Thank you.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Please help with this code 1
Why this error 2
DAO Create recordset from recordset 2
Access Write array data to access table 0
Recordset from a recordset 3
Run time error in VBA Code 1
Do loop 1
Data Type Conversion error 5

Top