Access VBA - Launch password protected database and close existing one
I am trying to set up a "Launcher" database which contains vba code that will open a second database which is password protected. (I can then convert the launcher db to accde so the VBA containing the password cannot be read) I have the following code so far... Private Sub Form_Load() Dim acc As Access.Application Dim db As DAO.Database Dim strDbName As String strDbName = "C:\database Folder\secureDB.accdb" Set acc = New Access.Application acc.Visible = True Set db = acc.DBEngine.OpenDatabase(strDbName, False, False, ";PWD=swordfish") acc.OpenCurrentDatabase (strDbName) Application.Quit End