Your loop keeps going until you reach the end of the recordset (after all the records).. but it seems that you are already at the end of the recordset before the loop starts - which is why there is no data to be retrieved by that line (and hence the error).
You need to basically not let the loop run if there is no data, which can be done by:
a) Putting an IF block around the loop. eg:
or b) Changing the structure of the loop slightly (so it is never entered if there is no data - but still exits at the end of the data), eg:VB Code:
If Not rsURL.EOF Then Do ... Loop While Not rsURL.EOF End If
VB Code:
Do While Not rsURL.EOF ... Loop




Reply With Quote