Citrus Rain
Citrus Rain

Reputation: 139

Infinite classic Asp do while loop

I have this same type of loop running on several pages, but the one that I said I'd get done in 1 day just... Ignores the out.movenext and prints only the first result out of a possible 10 results until it crashes. The SQL is fine. I got it with a tracer.

Changes: I originally had the movenext last before the loop - but moved it up one line for tracing. Tried (out = out.movenext , out = out.next) to see if it would do anything. And I tried putting an integer count in to have it stop after 20 loops so I can debug it faster. The int changes, the data prints, but out doesn't advance.

strSQL = "SELECT [RecordID],[SubmitDate],[DataEntered] FROM [ManagerFileReview] where submitdate = '" & timetap & "'"
out = cnt.execute(strSQL)
out.movefirst
response.write "<table>"
Do while not out.eof 
    response.write "<tr><td>"
    response.write "<table><thead></thead>"
    response.write "<tr><td>Submit Date:</td><td>" & out(1) & "</td></tr>"
    response.write "<tr><td>Data Entered:</td><td>" & out(2) & "rrrrrrrrrrr</td></tr>"
    out.movenext
    response.write "passed movenext</table></td></tr>"
loop
response.write "</table>"

Edit: Forgot the "SET" before the cnt.execute

Upvotes: 1

Views: 2248

Answers (2)

Citrus Rain
Citrus Rain

Reputation: 139

Found it. Didn't have SET before the out = cnt.execute(strSQL)

Should have been

set out = cnt.execute(strSQL)

Upvotes: 1

Tom Collins
Tom Collins

Reputation: 4069

The logic looks OK, unless I'm missing something. Even though out isn't listed as a reserved word with MS, I do wonder if it's the problem.

Upvotes: 1

Related Questions