Summary

This example supplements the examples in the Arcana Scheduler ActiveX API documentation.

It demonstrates how to retrieve an existing job and, optionally, to execute that job.

The example is written in Visual Basic.

More Information

Dim session As ADSSession
Dim job as ADSJob

'Sample assumes that client is on the same computer as the server.
'Would need to use CreateObject to create remote object if they were on separate computers.
Set session = New ADSSession

'After creating session, must call Connect to authenticate client. This sample assumes that the user
'can be authenticated using NT security and no password is needed. If Scheduler is configured to require
'a password, specify it in the Connect call.
session.Connect

'Get the job with the description "Test Job". GetJobForDescription is the easiest way to retrieve a job,
'as long as you know what it's called. GetJobForTag is more reliable, if you have set a tag for the job.
set job=session.GetJobForDescription("Test Job")

'Do whatever you wish with the job now. Be sure to save it and the session if you make changes.
'See the example in the API documentation for information on setting properties and saving objects

'You could also execute the job at this time (equivalent to the "Run Now" command in the Administrator):
job.Run


Set job=nothing
Set session = Nothing