D
david epsom dot com dot au
In Access 2000+, if you do
OpenDatabase("c:\mydb")
as the first action after opening a database, it creates
a new dbEngine object, not using the workgroup/user
credentials from Access. If you have a secured database,
the OpenDatabase action fails. In contrast, this works:
Application.dbEngine.OpenDatabase("c:\mydb")
the dbEngine object inherits the security credentials
from Access startup.
I don't know if this is just 'delayed' initialisation of
the dbEngine object (in which case it will come good after
a time, and may be difficult to demonstrate), or if it
is 'On Demand' initialisation (in which case you always
need to perform some action to initialise the dbEngine
object from the Application object before using OpenDatabase).
I can't help but notice that it raises the possibility of
obscure coding strategies to deliberately initialise the
dbEngine object with different security credentials than
those used at startup! But I think that even without that
it may be the source of occasional obscure errors.
(david)
OpenDatabase("c:\mydb")
as the first action after opening a database, it creates
a new dbEngine object, not using the workgroup/user
credentials from Access. If you have a secured database,
the OpenDatabase action fails. In contrast, this works:
Application.dbEngine.OpenDatabase("c:\mydb")
the dbEngine object inherits the security credentials
from Access startup.
I don't know if this is just 'delayed' initialisation of
the dbEngine object (in which case it will come good after
a time, and may be difficult to demonstrate), or if it
is 'On Demand' initialisation (in which case you always
need to perform some action to initialise the dbEngine
object from the Application object before using OpenDatabase).
I can't help but notice that it raises the possibility of
obscure coding strategies to deliberately initialise the
dbEngine object with different security credentials than
those used at startup! But I think that even without that
it may be the source of occasional obscure errors.
(david)