ADO not DAO

jl39775

Registered User.
Local time
Today, 19:16
Joined
Dec 12, 2001
Messages
43
I am using the below code in a module to access a table. How can I do this using ADO.
The database is already open. I can not declare the ADO as a database.

Dim MYdb As Database
Dim MYrs As Recordset

Set MYdb = CurrentDb
Set MYrs = MYdb.OpenRecordset("select * from UploadInventory", dbOpenDynaset)

Please help,

James
 
First, make sure the proper references are set for ADO. Then:

Dim MYdb As ADODB.Connection
Dim MYrs As New ADODB.Recordset

Set MYdb = CurrentProject.Connection
MYrs.Open "select * from UploadInventory",Mydb, adOpenDynamic, adLockOptimistic
 
cpod,

Thanks, this is what I need.

James
 

Users who are viewing this thread

Back
Top Bottom