I am running a VI job ( against Sage 2014 ) to import Purchase Orders from within MS Access using wscript.shell. It looks something like this:
Set objShell = CreateObject("WScript.Shell")
objShell.CurrentDirectory = gsMas90PathHome
objShell.Run sCommandToRun, , True
sCommandToRun looks like this:
"Z:\MAS90\home\PVXWIN32.EXE ..\LAUNCHER\SOTA.INI ..\SOA\STARTUP.M4P -ARG DIRECT UION <user> <pass> <company> VIWI00 AUTO"
Unfortunately, the command returns back to the application before the job is finished running. I need the application to wait until the job is finished, but am having a hard time coming up with a solution.
I was going to use a query against the SY_ActivityLog table, but that query is acting funky when run within the code.
What is the best way to handle this?
Thanks in advance!