Beginner DAO question

thebign

Registered User.
Local time
Today, 05:45
Joined
Jan 6, 2005
Messages
11
I'm new to programming, and was trying to copy some code from a text book using Access 2000.

Dim dbs as Database
Dim rst as DAO.Recordset

When I try to write this code, there is no "Database" class that shows up, nor is there any "DAO" "dot" anything, which of course leads to many errors when I try to run the code. I've looked in the System directory and there are a few DAO*.DLL files. What do I need to do use these objects in Access 2000. Any suggestions would be great. Thanks.
 
The,

Get your code in Design View,

Tools --> References

Scroll down the list and check Microsoft DAO 3.6

Use the Search Facility here and look for "references" for more info.

Wayne
 
As an additional note, keep in mind the database references can be done through either DAO or ADO objects. Access 2000 dafaults to ADO, so once you include the DAO reference, always preface each database object explicitely with either "DAO" or "ADODB". Otherwise you will get similar errors you had just now.

I know it sounds simple, but it took me a week to figure this out a long time ago... sometimes the stupid problems give us the biggest headaches.
 

Users who are viewing this thread

Back
Top Bottom