Timeout causes script to terminate - WeOnlyDo Discussion board

Timeout causes script to terminate (General questions)

by Logan, Friday, June 27, 2008, 04:37 (5993 days ago)

I just bought wodssh activex.

I am struggling with on error resume next in windows 2000 and .vbs vb script. I have a loop in sql and am doing a task for each record, however when processing one record and wodssh hits the global timeout the entire script terminates instead of moving to the next record, even though I have on error resume next. Any ideas?

Sub getstorelist()
'Connect to SQL on CAWUPMON and get list of current stores to pass to checkmodem function
Set objADOConna = CreateObject( ADODB.Connection )
Set objRSa = CreateObject( ADODB.Recordset )
objSQLConna = Provider=SQLOLEDB; Data Source = cawupmon; Initial Catalog = WhatsUp; User Id = readonly; Password = readonly;
objADOConna.Open objSQLConna
set objRSa = objADOConna.Execute ( SELECT left(sDisplayName, 4) AS storeNums from device where (nActionPolicyID = 4358 or nActionPolicyID = 4837 or nActionPolicyID = 5053) ORDER BY sDisplayName )
Do While Not objRSa.EOF
router = objRSa( storeNums )
tasklist()
objRSa.MoveNext
Loop
objRSa.Close
objADOConna.Close
Set objRSa = Nothing
Set objADOConna = Nothing
WScript.Quit 1
End Sub


if err.number <> 0 then
wscript.echo *********************
wscript.echo ERRORS FOUND
wscript.echo & err.number
wscript.echo & err.description
wscript.echo & err.source
wscript.echo *********************

GetCurrentTime = Now
Set objFSO = CreateObject( Scripting.FileSystemObject )
Set objTextFile = objFSO.OpenTextFile( c:scriptscheckmodemscripterrors.csv , 8, True)
objTextFile.WriteLine(GetCurrentTime & , & router & , & err.number)
objTextFile.WriteLine(GetCurrentTime & , & router & , & err.description)
objTextFile.WriteLine(GetCurrentTime & , & router & , & err.source)
objTextFile.Close

err.clear
errorcheck = 1

end if


Complete thread: