I'm trying to start a database application with a call to shell. When a dialog box is opened for a password, I try to suply it through Sendkeys.
The following code opens correcly the database, BUT the computer blocks until the Start key is pressed (a way to do it, only).
routeAcc = SysCmd(acSysCmdAccessDir) & "msaccess.exe "
Cmd = Chr(34) & rutaAcc & Chr(34) & " /NoStartup /User Admin /Pwd " & Chr(34) & "" & Chr(34) & " /wrkgrp " & Chr(34) & DBEngine.SystemDB & Chr(34) & Chr(34) & Routedb & Chr(34)
dwProcessID = Shell(Cmd, WindowStyle)
If dwProcessID = 0 Then
Error ERROR_IN_PROCESS
End If
SendKeys myPwd & "{ENTER}", True
hProcess = OpenProcess(SYNCHRONIZE, False, dwProcessID)
If hProcess = 0 Then
Exit Function
Else
CloseHandle hProcess
End If
Please, can you tell me how solve it.
Thanks in advance.
The following code opens correcly the database, BUT the computer blocks until the Start key is pressed (a way to do it, only).
routeAcc = SysCmd(acSysCmdAccessDir) & "msaccess.exe "
Cmd = Chr(34) & rutaAcc & Chr(34) & " /NoStartup /User Admin /Pwd " & Chr(34) & "" & Chr(34) & " /wrkgrp " & Chr(34) & DBEngine.SystemDB & Chr(34) & Chr(34) & Routedb & Chr(34)
dwProcessID = Shell(Cmd, WindowStyle)
If dwProcessID = 0 Then
Error ERROR_IN_PROCESS
End If
SendKeys myPwd & "{ENTER}", True
hProcess = OpenProcess(SYNCHRONIZE, False, dwProcessID)
If hProcess = 0 Then
Exit Function
Else
CloseHandle hProcess
End If
Please, can you tell me how solve it.
Thanks in advance.