tell
asked on
Open Access database
I'm trying to open my Access 97 database "test.mdb" in Visual Absic 5.0 under Windows 98 with the following code:
Global gDatabase As Database
Global gsDatabaseName As String
gsDatabaseName = "C:\Test.mdb"
Set gDatabase = OpenDatabase(gsDatabaseNam e, False, False)
and get the runtime error 429 (ActiveX component can't create object).
Can anybody give me advice ???
Global gDatabase As Database
Global gsDatabaseName As String
gsDatabaseName = "C:\Test.mdb"
Set gDatabase = OpenDatabase(gsDatabaseNam
and get the runtime error 429 (ActiveX component can't create object).
Can anybody give me advice ???
Have you added the DAO reference in your project?
It needs to be DAO 3.5 or higher it is under project/reference on your menu.
ASKER
Reference DAO 3.51 is added in my project.
ASKER
... and I already re-installed VB 5.0 just in case I damaged the DLL somehow.
Following is the only note in the help file for RT 429 that sounds reasonable. Do you by any chance have the database open with access while you're trying to run your VB program?
"Access to the object has explicitly been denied.
For example, you may be trying to access a data object that's currently being used and is locked to prevent deadlock situations. If that's the case, you may be able to access the object at another time."
I started a new project, then
dropped your Global statements into a module, then
dropped your two program statements onto a command button, changing the filename to a database on my system, then
added the DAO 3.51 library under project references
I then ran the project and click the button, it ran fine.
"Access to the object has explicitly been denied.
For example, you may be trying to access a data object that's currently being used and is locked to prevent deadlock situations. If that's the case, you may be able to access the object at another time."
I started a new project, then
dropped your Global statements into a module, then
dropped your two program statements onto a command button, changing the filename to a database on my system, then
added the DAO 3.51 library under project references
I then ran the project and click the button, it ran fine.
ASKER
Sorry, but my database is not openend by another application while I'm trying to run my project.
???
???
have you run in debug mode and make sure that the error is owing to
the Set gDatabase = OpenDatabase(gsDatabaseNam e, False, False) statement?
the Set gDatabase = OpenDatabase(gsDatabaseNam
ASKER
Yes I ran my project in debug mode and the error comes from the open database statement.
Maybe my DLL on the installation disk is damaged. Where can I get a new file?
Maybe my DLL on the installation disk is damaged. Where can I get a new file?
Can you open it by using VISDATA (Visual Data Manager)?
Try repairing your MDB.
Try repairing your MDB.
Also try positioning your reference to DAO as high in the reference list as possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.