Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QueryDef and DAO reference????

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
0
0
US
Hi,
I am using QueryDef to call existing queries in my database. In my references, the following is checked.
Microsoft DAO 2.5/3.51 Compatibility Library

Is this necessary to use the QueryDef? I tried to select DAO 3.5 and 3.6 obejct library, but it gives me a type mismatch error.

How can I fix this problem???


Thanks!
sjh
 
Try:

Dim MyDb as Database
Dim MySet as Recordset

Set MyDb = CurrentDB
Set MySet = MyDb.Openrecordset("YourQueryName", DB_OPEN_DYNASET)

 
The problem is with your declaration. Microsoft Access support ADO and DAO. You now must specifiy the recordset you want to work with.

Dim MyDb as DAO.Database
Dim MySet as DAO.Recordset

Set MyDb = CurrentDB
Set MySet = MyDb.Openrecordset("YourQueryName", DB_OPEN_DYNASET)


God Bless!

Jamie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top