Hi, is there way to get Pointer to NEW Access-secure-instance, without prompting for user pasword FROM ACCESS ?
Code:
If ll_RUN_SHELL Then
lc_AC_EXE = SysCmd(acSysCmdAccessDir) & "MSACCESS.EXE"
lc_USER = CurrentUser
lc_PWD = "password"
lc_DB_SEC_CMD = " /NOSTARTUP /USER " & lc_USER & " /PWD " & lc_PWD
lc_DB_SHELL = lc_AC_EXE & " " & filePath & lc_DB_SEC_CMD
ln_RC = Shell(lc_DB_SHELL, vbNormalFocus)
If SHELL_STARTED(CLng(ln_RC)) Then
Set oRetApp = GetObject(, "Access.Application")
[COLOR=red]' Returns pointer to First/CurrentDatabase, not to Second/Shell_DB...!!![/COLOR]
' Need for : oRetApp.Run "XX_MAIN"
If Not (oRetApp Is Nothing) Then
ll_Ret = True
WW_SET_ForeGWIN oRetApp.hWndAccessApp
End If
End If
Else
'[COLOR=red] if Secure, *** Prompts *** User for Password...[/COLOR]
' bStrPassword = DB-password (Not User password)
[COLOR=red]' MISSING --–> optional bStrUserPassword as String :mad:[/COLOR]
oRetApp.OpenCurrentDatabase filePath, Exclusive
End If
Last edited: