Code Problem

Crazy

Registered User.
Local time
Today, 20:27
Joined
Aug 2, 2001
Messages
14
i have this code:

Dim db As Database
ChDir Application.DefaultFilePath
a = Dir("MAG.MDB")
If a = "" Then
MsgBox "MAG.MDB not found"
Exit Sub
End If
Set db = Workspaces(0).OpenDatabase(a)
MsgBox "MAG.MDB is now open"
' use database here
db.Close

which i am using to open a database from excel, however u get a 'user type not defined error' wonder if anyone could enlighten me as to how i could correct this?
 
Sounds like a references problem to me. Verify that you are calling the DAO library in order to define the data type "Database."
 

Users who are viewing this thread

Back
Top Bottom