Opening a second secure database without seeing the dialog box

J

John Baker

I have some code which opens another access database.
The code is: (which works fine)

Const q As String * 1 = """"
strUpdateTool = "C:\Program Files\Microsoft
Office2003\OFFICE11\MSACCESS.EXE " & q & strPath & q & " /wrkgrp " & q &
wrkgrpPathAndName & q & " /user " & q & "Administrator" & q & " /pwd " & q
& "aaa" & q
Shell strUpdateTool, vbNormalFocus


I am trying to avoid reentering the username and password when the new
database opens.

The above code seems to work fine but I would like to get the current user
and their password and use this info to log in to the new database.
I can retrieve the user with the CurrentUser code but am not sure how to get
the password.

Also I would like to pass this information to a file so that a third
database can similarly be opend from the second database. Hopefully I can
then read the username and password from the file. Is their a problem with
writng a password to a file and then being able to retrieve it?

Any help greatly appreciated.
John B
 
D

Douglas J. Steele

No code exists to return the password. Thank goodness for that: Access
wouldn't be very secure if it were that easy to determine passwords, would
it? (Not that it's very secure as it is)

Writing to a file isn't too difficult, though.

Dim intFile As Integer
Dim strFile As String

strFile = "full path to file"
intFile = FreeFile

Open strFile For Output As #intFile
Print #intFile, "UserName=" & CurrentUser()
Print #intFile, "Password=" & strPassword
Close #intFile
 

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