Results 1 to 2 of 2
2003-06-19, 17:26 #1
- Join Date
- Feb 2001
- Trenton, New Jersey, USA
- Thanked 0 Times in 0 Posts
Dbengine not recognized (Access 97)
We are beginning to have problems with an old database which the agency is in the process upgrading and rewriting.
Starting today a computer will not recognize Dbengine.Workspace(0).Database(0) in the following code.
Access 97 is the same on this machine and another that processes this function.
Function GetCity(zipin As Variant) As Variant
Dim MyDB As Database ' Declare database.
Dim ZipCodes As Recordset ' Declare table.
Set MyDB = DBEngine.Workspaces(0).Databases(0) ' Create database reference.
Set ZipCodes = MyDB.OpenRecordset("tblZipCodes", DB_OPEN_TABLE) ' table reference.
On Error GoTo ErrCity
ZipCodes.Index = "PrimaryKey"
ZipCodes.Seek "=", zipin
If ZipCodes.NoMatch Then
MsgBox ("No match was found for Zip-Code ")
MyCity = "XXXXXXXXXX"
MyState = "XX"
MyCounty = "XXXXXXXXXXXX"
MyCity = ZipCodes!City
MyState = ZipCodes!State
MyCounty = ZipCodes!County
Forms![frmContactType]![Field25] = MyCity
Forms![frmContactType]![Field27] = MyState
Forms![frmContactType]![County] = MyCounty
MsgBox ("No match was found for ZipCode2 ")
2003-06-19, 18:20 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: Dbengine not recognized (Access 97)
I assume you've checked for missing references on this computer too? (Cf. <post#=266096>post 266096</post#>)