Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionTimeout = 0
Set rs = CreateObject("ADODB.recordset")
strSQL = "SELECT * FROM myTable"
maxcount = 10 'dont allow an infinite loop
count=0 : ok = false
do while count<maxcount and ok=false
rs.open strSQL, objConnection , 3,3
if rs.eof then
'no records so wait
xx = timer
do while timer < xx + 6000 * 5 'waite 5minutes
if ok then
'work on records
wscript.echo "gave up waiting after " & maxcount & " tries"
Set rs = Nothing
Set objConnection= Nothing
Open in new window
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $159.20.
Premium members get this course for $108.00.
Premium members get this course for $122.40.
Premium members get this course for $62.50.
Premium members get this course for $174.99.
Premium members get this course for $49.99.