I work with Access runtime version and I need to open an encrypted database .accdb. I created a dummy file to work with getobject and opencurrentdatabase statement. I
can't work with CreateObject("Access.Application") or new access.application because this is the runtime version.
My code is this, and works fine but when I open the encrypted database the UserControl property is false, and it opens whith any access message like docm.setwarnings in false and "docm.setwarnings
true" doesn't work.
Dim appRT As Object
Public Sub OpenEncryptDb()
Const Q As String = """"
strPathEncryptDb = CurrentProject.Path & "\encryptdb.accdb"
strPathToDummy2 = CurrentProject.Path & "\dummy.accdb"
strPathToRuntime = SysCmd(acSysCmdAccessDir) & "msaccess.exe"
Shell Q & strPathToRuntime & Q & " /RUNTIME " & Q & strPathToDummy2 & Q, vbNormalFocus
Set appRT = GetObject(strPathToDummy2)
With appRT
.CloseCurrentDatabase
.OpenCurrentDatabase strPathEncryptDb, False, "123456" 'open encrypt database
.DoCmd.RunCommand acCmdAppMaximize
End With
End Sub
I shared the code in this link
https://1drv.ms/u/s!AsgXxStf7QGagQZIk8hcJShbCIye
open first the master.accdb file. Note that when you open the final file "encryptdb.accdb", you can delete rows and you don't receive any confirmation message that regularly you receive when you delete rows in MS-Access like "master.accdb"