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

Access 97 to 2K Conversion-- Question 1 of 10,000!

Status
Not open for further replies.

DaveShmave

Programmer
Dec 30, 2000
40
US
I have just started looking at a 97 database that has been converted to 2K. I noticed one of the References said 'Microsoft DAO 3.6 Object Library'.

This may seem like a stupid question, but why if I remove the DAO object library listed above does my code no longer work, specifically 'Dim db As CurrentDb'?

I noticed on new Access 2K databases the DAO object library and one other VBA related object library (found in the converted database) are missing.

So assuming I wanted to start from scratch, how would I code the line 'Dim db As CurrentDb' in a new Access database, not one that's been converted?

Thanks,

Dave

I'm only joking about the 10,000 questions. It will just seem like it to me.
 
You don't have to start from scratch - you can continue using DAO - by default A2K uses ADO but you can add DAO. If you open you db and view the code in the VB editor then go to Tools -> References and place a check in the box next to Microsoft DAO 3.6 Object Library, you will be able to use the existing code.

HTH,
JC
 
Hi!

You could, as Mongooses state, use the DAO library in A2K projects.

If you want't to change to the new Library, ADO, which in my experience, is a bit faster, the syntax for declaring and opening "database and recordset" variables would be something like this;

Dim rs As ADODB.Recordset

With rs
.ActiveConnection = CurrentProject.Connection
.LockType = adLockReadOnly
.CursorType = adOpenForwardOnly
.Open "tblTest", options:=adCmdTable
End With

The rest of the syntax is about the same as when using the DAO-Library. Check out the help on those issues and perhaps also which CursorType/LockType to use in your challenges;-)

Have fun, Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top