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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Dim As Database in Access 2000

Status
Not open for further replies.

nufather

Programmer
Mar 18, 1999
29
US
I am stuck on 2000 trying to Dim - What is the command - database isn't one of them - it can dim as DataAccessPage or Pages but nothing there stating database - please help.
 
Remember that in Access 2000 ADO is the default data access model and not DAO. Thus, the reason you do not see Database as an option is because it isn't one in ADO (you are probably looking at the Connection object). However, if you still wish to work with DAO instead of ADO, then go to Tools ¦ References while you are in a code module and find the DAO library and check it. At the same time, you might want to uncheck your reference to the ADO library since doing something as Dim rs as recordset will mean you have defined a new ADODB recordset and NOT a DAO recordset.<br>
In terms of this, you may also want to start definding your objects with the object library's prefix... example DAO.Recordset instead of Recordset. This will save you tonnes of debugging later as ADO and DAO do act somewhat differently. To check out some of the differences, go to <A HREF=" TARGET="_new">
 
Here's what I found out<br>
If you were used to using <br>
<br>
Dim db as database, rst as recordset<br>
<br>
then change it to<br>
<br>
Dim db as DAO.database, rst as DAO.recordset<br>
<br>
and everything will work like before.<br>
Also in the VBA program make sure you have the DAO 3.6 box checked in the Addins. VBA is a separate program and <br>
I don't have Access 2000 here in front of me but it starts with the word 'Microsoft' and its the only one that has 3.6 in it.<br>
<br>
Hope this Helps<br>
DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top