Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access won't recognize Database or QueryDef

Posted on 2001-09-17
6
Medium Priority
?
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 200 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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