infenite loop in vbscript

July 15, 2013 at 02:57:16
Specs: Windows Server 2003
Im running one query to check the status of the Job.. The job runs for few minutes. The column STATUS of the table shows whehter the job completed or not. The STATUS shows COMPLETE if the job completes. The STATUS shows ERROR if it is error out.

ConnectString = "Driver={SQL Server};Server=Sev_123;Database=DB_123"
Const SummaryQuery = "select STATUS from EDI_JOB_HDR where TP_SEQ = 10288"

Set fso = CreateObject("Scripting.FileSystemObject")
Set com = CreateObject("ADODB.Command")
com.ActiveConnection = ConnectString
com.CommandText = SummaryQuery
Set rs = com.Execute
Please help me here, We need to execute the query unitil we get the resultset. If the resultset is COMPLETE we need to exit the program with return code 0, if the resultset is ERROR exit the program with retun code 1.
Please provide your unput on this..

See More: infenite loop in vbscript

Report •

July 23, 2013 at 12:42:35
What are you getting before the job completes? A null? "RUNNING"? Something else? Nothing?

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question