Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dim db as database 2

Status
Not open for further replies.

lanelouna

Programmer
Dec 19, 2002
71
GB
hello
i have a simple question
i hope someone can answer
in access 2000
the expression: dim db as Database
doesn t work?
why it keep giving me error
what is weird is that it works with a base i upgraded from access95 (version 7), in access 2000, howeveri f i create new base in 2000, or i import all the modules and forms...from that base into a new one, it doesn t work
can anyone explain to me why? and give me asolution as well
thank you

Lina Chebli
 
Try
dim db as DAO.database

Also, do the following:

edit a module
go to tools:references
make sure DAO 3.6 is checked.
 
thank you it accepted it when i checked DAO 3.6
however it gave me a second error
about recordsets:
RS.EDIT
can't find this methode
can you help again?
 
Database is a DAO object.
Access 2000 and XP work by default with ADO and the reference to DAO is not set, so if you try to declare DAO object variables such as Database, TableDef, QueryDef, you'll fail.

Either go with ADO model (you'll have to learn it some day, it's not so difficult) or set a reference to DAO 3.6. Object library.

Access 2000 converted your old application to the newer version of Access, but kept the DAO reference. Whenever you create a new application, you do not have this reference, therefore your declarations fail.

HTH

Dan [pipe]
Daniel Vlas
Systems Consultant
 
thank you Daniel for this detailed explanation
now i understand!
i didn't know there was a difference
until i tried to do what i did
thanks again
i appreciate it alot

Lina chebli

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top