Solved

Access won't recognize Database or QueryDef

Posted on 2001-09-17
6
229 Views
Last Modified: 2008-03-10
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
Comment
Question by:joGor
6 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 50 total points
ID: 6488929
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
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 6489741
yes it sounds like the ADO Library id being referenced rather than the DAO Library
0
 

Expert Comment

by:Keza
ID: 6490013
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:joGor
ID: 6490440
Yes it was just a reference to the DAO 3.6 that was not checked... how annoying. Thanks all!
0
 
LVL 54

Expert Comment

by:nico5038
ID: 6490477
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
 

Expert Comment

by:jrsumner
ID: 8678895
Thanks.  This helped me out as well!
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now