jobRunner.vbs: Sub DeleteFromQueue

Delete all rows containing Task, Name and Profile from the Queue table.
 

Sub DeleteFromQueue(Task, Name, Profile)

    Dim objDB, sqlQuery

    Set objDB = CreateObject(“ADODB.Connection”)

    objDB.Open DB_CONNECT_STRING

    If Profile = “” Then

        sqlQuery = “delete from ” & DB_TABLE_QUEUE & ” where Task='” & Task & “‘ and Name='” & Name & “‘”

    Else

        sqlQuery = “delete from ” & DB_TABLE_QUEUE & ” where Task='” & Task & “‘ and Name='” & Name & “‘ and Profile='” & Profile & “‘”

    End If

    objDB.Execute sqlQuery

    objDB.Close

End Sub