Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if a process has completed.

Status
Not open for further replies.

ghalewood

Programmer
Nov 13, 2001
42
EU
Hi All,

I am building an Access DB to control the running of Essbase loads and recalcs on a number of different cubes. I believe that I can use the shell command to start the dataloads and recalcs. As some of the recalcs take hours and I can't wait until one load/recalc has finished before I can start another. I need to have a method of seeing if a process is still running.

The shell command will provide me with the process number

intPid = Shell("D:\essbase\Esscmd.exe D:\Calc.esc")

How can I use the intPid to determine if the process is still running?

The cubes are on the same server and are populated using data extracts from the mainframe. These data files can arrive at different times. My application would check to see if the files have arrived, start the load, then send mails when the load has finished or warning mails if they haven't finished after a certain time.

Thanks in advance
Graham
 
This may help:
Shell Program and Control (MS Access)
thread709-1193536

 
I think I have it. I'll have a play around with the code.

Thank You.

Code:
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long


Private Const SYNCHRONIZE = &H100000



    ' Wait for the App
    hProc = OpenProcess(SYNCHRONIZE, 0, lProcID)
    If hProc <> 0 Then
        'hasn't finished, carry on with other things
    End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top