Open a database with a password

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.
 
D

David Lloyd

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top