The attached code properly displays the message box for the first record that matches the criteria, however it then just repeats the messagebox for the same record indefinitely. I've used a similar setup before, but it was ASP. This is straight VBS and I must be missing something simple.
counter = 0
limit = 5
Set cConnection = CreateObject("ADODB.Connection")
//setting variables here for connection string, username, password.
SQLstmt = "SELECT field1, field2 from Table1 WHERE Field1 IS NULL"
Set RS = cConnection.Execute(SQLstmt)
while (not RS.EOF) AND (counter < limit)
msgbox("Field1: " & RS.Fields.Item("field1").value)
//do other stuff
counter = counter + 1