Solved

User-defined type not defined (dim db as Database)

Posted on 2004-09-17
3
290 Views
Last Modified: 2008-03-06
I've been using an access database at work and recently loaded it on my home PC, but can't seem to get it to recognize a variable as a Database.  I tried to match up my references, but my computer does not contain the same list (missing Microsoft Common Controls 5.0 and 6.0).
0
Comment
Question by:Drako357
  • 2
3 Comments
 
LVL 12

Expert Comment

by:pique_tech
ID: 12086473
You have to uncheck the missing references to get all your functions to work right.  Ideally, if you're going to use those two libraries, then you should get them for your home computer too.
0
 
LVL 13

Accepted Solution

by:
lucas911 earned 100 total points
ID: 12086488
Add this reference to your module:

Microsoft DAO 3.6 Object Library

And in your code to declare your database variable and your recordset variable do it like this:

Dim db as DAO.Database
Dim rs as DAO.Recordset

0
 
LVL 12

Expert Comment

by:pique_tech
ID: 12086498
It also helps to disambiguate your variable declations by declaring which library they're from, i.e., "dim db as DAO.Database" or "dim rs as ADODB.Recordset"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 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