D
David McDivitt
I am trying to set the current database for the access application object
through code and keep getting the error 7866: Microsoft Access can't open
the database because it is missing, or opened exclusively by another user.
At the start of the code I do the following:
dao.DBEngine.SystemDB =
dao.DBEngine.DefaultUser =
dao.DBEngine.DefaultPassword =
With this I can successfully use the DAO opendatabase method and do stuff.
At another phase I need to create an application object and set the current
database for that object. Open creating the application object the first
thing I do is:
TempApp.DBEngine.SystemDB =
TempApp.DBEngine.DefaultUser =
TempApp.DBEngine.DefaultPassword =
Following this, when I do the opencurrentdatabase method I get the 7866
error. The problem is probably because dbengine is already initialized,
though I have not yet done anything with the application object. Setting the
dbengine values only works before it is initialized. To fix, the values must
be put in an ini file or in the registry, and those values read by
MSAccess.exe when it creates the application object. Can someone tell me how
to do that? Thanks
through code and keep getting the error 7866: Microsoft Access can't open
the database because it is missing, or opened exclusively by another user.
At the start of the code I do the following:
dao.DBEngine.SystemDB =
dao.DBEngine.DefaultUser =
dao.DBEngine.DefaultPassword =
With this I can successfully use the DAO opendatabase method and do stuff.
At another phase I need to create an application object and set the current
database for that object. Open creating the application object the first
thing I do is:
TempApp.DBEngine.SystemDB =
TempApp.DBEngine.DefaultUser =
TempApp.DBEngine.DefaultPassword =
Following this, when I do the opencurrentdatabase method I get the 7866
error. The problem is probably because dbengine is already initialized,
though I have not yet done anything with the application object. Setting the
dbengine values only works before it is initialized. To fix, the values must
be put in an ini file or in the registry, and those values read by
MSAccess.exe when it creates the application object. Can someone tell me how
to do that? Thanks