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

Dim dbs as Database not valid 3

Status
Not open for further replies.

SKILTC

IS-IT--Management
Apr 3, 2001
6
US
I have used the Dim dbs as Database in my code in '95, '97 but I am not getting that option in '2000. I get Compile error: User-defined type not defined. The Help sections use database as a valid parameter. Why is it not working for me?

Code example:
Dim dbsmds as database, rst as recordset
set dbsmds = dbengine.workspaces(0).opendatabase ("c:\my documents\Biller")
set rst = dbsmds.openrecordset("Bill detail")

with rst
.addnew
![newmr]=forms![mdsinfo]![id]
![fac]=forms![mdsinfo]![facility]
.update
end with

This code works in earlier versions of Access but not 2000. Any help would be appreciated since I am converting everything over to 2000. Will this continue to be a problem in the new OfficeXP version??
 
You need to DIm dbs as DAO.database and rst as DAO.recordset. I had same problem when upgrading to 2000 cause by default, 2000 uses ADO not DAO.

Mary :)
 
You can also go to a code window and select tools-->references and move DAO to a higher priority than ADO. Mike Rohde
rohdem@marshallengines.com
 
Or -- you can use what you have if you add the 'Microsoft DAO 3.51 Object Library' which supports all the older Access 97 DAO code.

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top