Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: multiuser files Access MDB 1932 WinExec Error
The 1932 error says "... the process can't access the file because || it is being used by..." [msg truncated]
My code looks like:
RunIconWait("M:\serapps\crystal.mdb", "") ;to run Access fileand/or (same error with a FileMaker Pro file):
RunIconWait("d:\fmfiles\times.fm", "") ;to run FileMaker Pro file
Additional Details:
By specifying the MBD file in the Run statement, it forces a lookup in the registry of various parameters. Run, RunWait, or RunShell do not do it exactly like Explorer does.
The ShellExecute statement will emulate explorer - but it does not have a WAIT parameter.
I would suggest poking in the registry under hkey_Classes_root for .MDB and seeing what file type it is associated with, then looking under that file type - still in the classes section under something like xxxxx/shell/open/command and seeing the command line there.
Then try to recreate the command line * with the access exe file in a RunWait statement. There may have been a parameter that was getting dropped.
C:\Program Files\Microsoft Office\Office\MSACCESS.EXE /NOSTARTUP "%1"
Then I used the string in the RunWait. Here is my test wbt file.
prog="C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" app="m:\CirApps\Batch.mdb" RunWait("%prog%", "%app% /NOSTARTUP")I started the app directly (without WBT) at one workstation and then ran the wbt test file above at mine, successfully opening the app. Now, the problem with this approach is that the program's path (i.e., msaccess) could be different across workstations. So this precludes having a clean, standard wbt file.
The ShellExectute worked okay also, but it doesn't have a WAIT, which is required.
Can you guys either make the RunWait work like Explorer or put a WAIT in the ShellExecute????
Note, that if you are doing a RunIconWait, the iconized name of the program may not be the same as the title of the normal window. So you may need to Run the app as a normal window, do a WinIDGet on the window title, and then do a WinIconize, using the ID handle of the window as the window parameter in that function, as well as in the WinWaitClose function.
Also note that you often need to put a time delay in before the WinWaitClose, as it takes windows a few seconds to generate the title after the app is launched. So put TimeDelay(3) in before the WinWaitClose.
prog="msaccess.exe" app="m:\CirApps\Batch.mdb /runtime /x macSoref" ShellExecute(prog,app,"",@NORMAL,"") If WinWaitExist("Batch",20) WinWaitClose("Batch") Else Message("","The Soref process did not run.") exit Endif Message("","The operation completed sucessfully.")The good thing is that the WinWaitExist will either wait the full time specified or return as soon as the app is exited. This approach works (1) if the app never ran, (2) if it runs and closes before the WinWaitExist wait time is expired, or (3) if it runs for a long time before exiting.
Article ID: W13174
Filename: Open MultiUser Files on a Network.txt
File Created: 1999:04:15:16:52:14
Last Updated: 1999:04:15:16:52:14