This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Issue With Windows Script Monitor

Hello, I have an issue that i can't figure out. I keep randomly receiving the following errors:

"Script does not contain the expected parameters or is improperly formatted. 'Statistic' missing."

"is showing One or more errors occurred."

The script works majority of the time, but randomly fails with a message like i have posted above.

Any help would be appreciated.

dim sql1, IssueCount

  Set oConn1 = WScript.CreateObject("ADODB.Connection")

  Set oRS1 = WScript.CreateObject("ADODB.Recordset")

    oConn1.ConnectionString = "ConnectionString"

   oConn1.Open

   sql1 = "QUERY"

  

   oRS1.open sql1, oConn1,3 ,3

if not oRs1.eof then

    issueCount= oRs1("IssueCount")

        

   

    if(cdbl(issueCount)<=10) then

         Wscript.Echo "Message: " & issueCount & " Current Issues"

         WScript.Echo "Statistic: "& issueCount

         Wscript.quit(0)

    else

         Wscript.Echo "Message: " & issueCount & " Current Issues"

         WScript.Echo "Statistic: "& issueCount

         Wscript.quit(3)

    end if

else

  Wscript.Echo "Message: Failed to run query."

  WScript.Echo "Statistic: 0"

  Wscript.quit(1)

end if

set oRS1 = nothing

set oConn1 = nothing