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

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).
Drako357Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
LucasConnect With a Mentor MS Dynamics DeveloperCommented:
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
 
pique_techCommented:
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
 
pique_techCommented:
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
All Courses

From novice to tech pro — start learning today.