Open a database with a password

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
Do you mind to advise how the codes are written for prompting user a
password to open another database from the current database? Thank you for
your kindness.
 
I don't know all the details of your situation, however, one alternative to
open a database secured with a database password would be the following.
Because the password is not specified in the OpenCurrentDatabase method, the
user is prompted for the password.

'Module Level Declaration:
Dim acc As New Access.Application

'Function or Subroutine Code
Dim accAutoSec As MsoAutomationSecurity

'Capture current security setting
accAutoSec = acc.AutomationSecurity

'Reset the security to low temporarily to avoid the security warning
acc.AutomationSecurity = msoAutomationSecurityLow

acc.OpenCurrentDatabase "C:\db2.mdb", False

acc.Visible = True

'Reset the security level
acc.AutomationSecurity = accAutoSec

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi all,
Do you mind to advise how the codes are written for prompting user a
password to open another database from the current database? Thank you for
your kindness.
 
Back
Top