ADSJob class

Run method

 

The Run method instructs the Scheduler service to run the job immediately.

Syntax

 

C++

hr=job->Run()

VB

job.Run

Error Codes

The following error codes are commonly encountered with this method. See the Error Codes topic for additional error-handling information.

 

ADS_E_JOB_NOT_ENABLED

The job cannot be run because it is disabled. To run the job, you must first enable it.

Remarks

Execution of the specified job is based on the version of the job's configuration stored on the server. Therefore you must call Save for both the job and the session before calling Run if you have made changes to the job.

The Run method does not wait for the job to be executed. The return code from this method therefore does not reflect the status or outcome of running the job. To determine the status of the job, you must call Refresh for the session, re-read the job from the session (using either the GetJobForDescription or GetJobForTag method), then check the Status property.