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

Urgent. Object "Database"

Status
Not open for further replies.

brucomela

Programmer
Oct 15, 2001
52
0
0
IT
The program script "Dim dbs As DATABASE" worked with access 97, but not in Access 2000 (it's not compiled by the editor infact!), how has the object "DATABASE" been substituted?
 
THe default data lib for A2000 is ADO. Open a module in design view, click tools/references. Uncheck the ADO reference. Then scroll down and find "Microsoft DAO 3.60 ...." (it's close to that - don't remember the workding exactly - just look for "DAO") and check it.

Close the reference dialog and try a compile. SHould get no erros.

Note that you can use both ADO and DAO, but then you need to explicitly declare everything:

Dim rs1 as DAO.Recordset
Dim rs2 as ADO.Recordset

Jim.
 
JDettman, you're on the right way but I have another error: first only 4 references were checked: VB for apps, Microsoft Access 9.0 Object Library (impossible to uncheck, it's in use), OLE Automation and Microsoft ActiveX DataObject (unchecked now, correct?). Then I wrote the line dim dbs As Database but I got the error. I'm not so keen with Access, but why can I write Dim rst As Recordset and not Dim dbs As Database??? HELP ME!!!
 
Besides unchecking the ADO, you need to check the DAO reference. Please see first post.

Jim.
 
Sorry JDettman, didn't write, I've checked it, but the script Dim dbs As Database generates error! Dim rst As Recordset instead is perfectly accepted!!
 
Strange. First go in and check any reference. Close the MDB and Access. Now reopen and uncheck the reference you just checked. This will refresh the references again. Now try a compile. Still errors on the DIM dbs as Database?

If so, reregister the DAO lib by following step 1 in the MSKB article below:


Let me know
Jim.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top