johnstahl Posted September 25, 2008 Share Posted September 25, 2008 I am trying to develop a simple interface for DLQueue. I have been able to connect to the Queue, but I am not able to submit a job. Does any one have an example of what the submit should look like. Even better an example of a working application. Any lanuage is acceptable. The lack of examples in the doumentation can be very difficult. Thank you John Link to comment Share on other sites More sharing options...
Admin1676454018 Posted September 25, 2008 Share Posted September 25, 2008 John, What message or error are you getting when you try to submit? Link to comment Share on other sites More sharing options...
Dan Korn Posted October 8, 2008 Share Posted October 8, 2008 Below is a VB/VBScript example of a basic connection and job submission using the DL Queue Client API (DLQueueClient.ocx). It demonstrates how to poll and wait for a job to be completed. Option Explicit Function RunJob(CommandLine, SchedulerName, UserName, Password) Dim DLQClient1 As DLQueueClient Dim Status As DLQ_CONNECTION_STATUS Dim Job As DLQueueJob Dim Token As Long, MYERROR As Long RunJob = False Set DLQClient1 = CreateObject("DLQueueClient") Status = DLQClient1.ConnectRemote(SchedulerName, UserName, Password, 10) If Status <> DLQ_ConnStatus_Connected Then document.write _ DLQClient1.ConnStatusString(DLQClient1.ConnectionStatus), _ Title:="Connection failed" DLQClient1.Disconnect Set DLQClient1 = Nothing Exit Function End If document.write "Connected: ID=" & DLQClient1.Connection.ID & _ ' ", LoginName=" & DLQClient1.Connection.LoginName & _ ' ", MachineName=" & DLQClient1.Connection.MachineName Set Job = CreateObject("DLQueueJob") Job.CommandLine = CommandLine Job.Name = "Q1" MYERROR = DLQClient1.SubmitJob(Job, 10, False) Token = Job.Token Do Set Job = DLQClient1.GetJobByToken(Token) If Job Is Nothing Then Exit Do If DLQClient1.IsJobStatusFinal(Job.Status) Then Exit Do DLQClient1.Sleep 100 'DoEvents Loop If Job Is Nothing Then Document.write "Job not found after submission!" Exit Function End If Document.write "Job completed with return code " & _ Job.ReturnCode Set Job = Nothing DLQClient1.Disconnect Set DLQClient1 = Nothing RunJob = True End Function Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.