Open another DB with password

new_guy_tom

Registered User.
Local time
Today, 14:20
Joined
May 14, 2010
Messages
13
Hi, I am trying to open a database with a password (I know the password) from another database however I cannot work out how to do it. I have been using this code to do this to open databases without passwords for a while.

I am using Access 2007.

Any help on how to do this would be great! Thanks.

Code:
Private Sub Command36_Click()
Const cstrClientFEPath = "G:\Templates\"
Const cstrFEFile = "db.accdb"
  Dim intX As Integer             'Utility var
    Dim strCommandLine As String    'Application to run and file to open
    Dim strMSAccessAPP As String    'Folder path of Access Executable
    
    strMSAccessAPP = SysCmd(acSysCmdAccessDir) & "MSAccess.exe"
    
    'Build string
    strCommandLine = strMSAccessAPP & " " & Chr(34) & cstrClientFEPath & cstrFEFile & Chr(34)
    
    intX = Shell(strCommandLine, 3)
 
End Sub
 
Would it not be easier to just link the DB to the Front end?
 
Thanks guys. The backend and front end are linked together and the backend is on the network and password protected. The backend runs on the on the server and runs number of update queries from an external data source during the day, they run on the back end so that it does not interfere with the front end experience.

The problem is that the server restarts from time to time closing the backend. I wanted to have a blank database that loads on startup with a form with code in the on load event that will reopen the backend on the server. The blank database would be saved on the servers desktop so no one else would be able to load it. If the backend (which is password protected) can reopen on the server desktop without human intervention it means that I can have days off from work without interruption!

I have been trying this however it does not actually load the database http://support.microsoft.com/kb/209953 it just displays a record from a table in a message box.

Any help would be appreciated :)
 

Users who are viewing this thread

Back
Top Bottom