• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

Access won't recognize Database or QueryDef

Greetings,

I have a two simple lines of code

Sub thing()
    Dim db As DATABASE
    Dim qry As queryDef
   
End Sub

Access2000 doesn't recognize The Database object or the QueryDef object.

I get the error: "User-defined type not defined" Is there a certain library or option that I don't have selected? Very confused and frustrated....
0
joGor
Asked:
joGor
1 Solution
 
nico5038Commented:
Probably:
   Dim db As dao.DATABASE
   Dim qry As dao.queryDef
will work.

Just go in the code "mode" to Tools/References to see what modules are present. Make sure at least the Microsoft DAO ... Object library is present and "checked".

Nic;o)
0
 
Jonathan KellyCommented:
yes it sounds like the ADO Library id being referenced rather than the DAO Library
0
 
KezaCommented:
yes i have come across a simiar problem when converting an old version of access to the new version, the library in 2000 don't seem to recognise "QueryDef"
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
joGorAuthor Commented:
Yes it was just a reference to the DAO 3.6 that was not checked... how annoying. Thanks all!
0
 
nico5038Commented:
It will even be more annoying when you move your application to a machine with DAO 3.5
In such a case you'll need to change the reference, otherwise the strangest error's can occur...

But glad I could help, success with your aplication.

Nic;o)
0
 
jrsumnerCommented:
Thanks.  This helped me out as well!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now