The code below, though clumsy, works for me with a full installation of Access. I don't know if it works with only the Access runtime installed; I suspect it may not, but please test it if you can.
'------ start of code ------
Sub StartPasswordedDatabaseRuntime( _
strPathToDatabase As String, _
Optional strPassword As String, _
Optional strPathToRuntime As String, _
Optional blnQuit As Boolean)
' Start a runtime database that has a database password.
Dim appRT As Access.Application
Dim strPathToDummy As String
Dim blnStillOpen As Boolean
Const Q As String = """"
If Len(strPassword) = 0 Then
strPassword = InputBox("Please enter password:")
End If
If Len(strPathToRuntime) = 0 Then
strPathToRuntime = SysCmd(acSysCmdAccessDir) & "msaccess.exe"
End If
strPathToDummy = CurrentProject.path & "\Dummy.accdb"
If Len(Dir(strPathToDummy)) = 0 Then
Application.DBEngine.CreateDatabase strPathToDummy, dbLangGeneral, dbVersion120
End If
Shell _
Q & strPathToRuntime & Q & " " & Q & strPathToDummy & Q & " /runtime", _
vbNormalFocus
Set appRT = GetObject(strPathToDummy)
With appRT
.CloseCurrentDatabase
.OpenCurrentDatabase strPathToDatabase, , strPassword
End With
On Error Resume Next
blnStillOpen = True
Do While blnStillOpen
DoEvents
Err.Clear
If appRT Is Nothing Then
blnStillOpen = False
ElseIf Len(appRT.CurrentProject.path) = 0 Then
blnStillOpen = False
End If
If Err.Number <> 0 Then
blnStillOpen = False
End If
Loop
If blnQuit Then
Application.Quit ' if we're done here.
End If
End Sub
'------ end of code ------
Please note that the database where this code runs remains open, with the procedure code looping, while the runtime database is open. I've tried various methods to release that database to user control and exit, but so far without success.