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:
VB Code:
  1. If Not rsURL.EOF Then
  2.   Do
  3.     ...
  4.   Loop While Not rsURL.EOF
  5. End If
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:
  1. Do While Not rsURL.EOF
  2.   ...
  3. Loop