We use a script to start our Access Application, this does some work before the start of Access and after closing Access.
StartAccess3_2002.exe must necessarily wait until MSAccess (myApp.mde) has closed before the next statement is executed!
wait=0 is for us not the solution, because during this time the Application is opened, the protected registry values are not set!
our script:
Code:Set WshShell = WScript.CreateObject("WScript.Shell")
'
' do some work bevore open myApp.mde
'
cmdline = chr(34) & ProgramFilesDir & "\Microsoft Access Runtime\Office10\StartAccess3_2002.exe" & chr(34) _
& " /excl /runtime /wrkgrp C:\myAccApp\system\system.mdw C:\myAccApp\myApp.mde"
' & " -wait=0 /excl /runtime /wrkgrp C:\myAccApp\system\system.mdw C:\myAccApp\myApp.mde"
WshShell.Run cmdline, 1, True
' StartAccess3_2002.exe must necessarily wait until MSAccess (myApp.mde) has finished before the next statement is executed!
' wait=0 is no a solution, because otherwise the protected registry values are not setting.
WshShell.Popup "StartAccess3_2002.exe is finish.", 5, "Access App", 4096
'
' do some work after closing myApp.mde
'
WScript.Quit
'-----------------------------------------------------------------
Function ProgramFilesDir
Dim objShell, objFolder, objFolderItem
Const PROGRAM_FILES = &H26&
Const PROGRAM_FILESX86 = &H2A&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(PROGRAM_FILESX86)
If (objFolder Is Nothing) Then
Set objFolder = objShell.NameSpace(PROGRAM_FILES)
End If
Set objFolderItem = objFolder.Self
ProgramFilesDir = objFolderItem.Path
End Function
Does somebody have a solution?
Does exist a switch, i.e. -WaitOnReturn for StartAccess3_2002.exe which protect the registry values while it waits till the application is closed?
Or is it possible to implement a switch like -WaitOnReturn for StartAccess3_2002.exe?