DELJOB.EXE

Overview

DELJOB.EXE is a console mode application that can be used for deleting jobs from the SMS database. This code demonstrates datasource connection, folder deletion, scalar manipulation, and helper functions.

Running the Program

DELJOB.EXE runs as a console application. The program prompts you to enter the information needed to connect to SQL Server, then it prompts for the identifier of the job you want to delete. The application will display an error message if the job cannot be deleted. The program then quits.

Functions

SmsDataSourceConnect
SmsDataSourceDisconnect
SmsOpenContainer
SmsCloseContainer
SmsPopulate
SmsGetNextFolder
SmsGetFolderID
SmsUnlinkFolder
SmsCommitFolder
SmsCloseFolder

Program Flow

The application first establishes a connection to the datasource. Then, it opens a container of the type C_JOB and populates it. The user is asked for the identifier of the job to delete and then the job container is searched for a job matching the specified identifier. Finally, if the specified job folder is found, the job folder is deleted and the datasource is closed.