Solved

Access won't recognize Database or QueryDef

Posted on 2001-09-17
6
263 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 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

737 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