无限经典Asp做循环

时间:2012-05-09 17:07:20

标签: asp-classic

我在几个页面上运行了相同类型的循环,但是我说过我在1天内完成的循环只是...忽略out.movenext并仅打印出可能的10个结果中的第一个结果直到它崩溃SQL很好。我用跟踪器得到它。

的变化: 我最初在循环之前持续了movenext - 但是将它向上移动了一行以进行跟踪。尝试(out = out.movenext,out = out.next)看它是否会做任何事情。我尝试将整数计数放入20个循环后停止,这样我就可以更快地调试它。 int更改,数据打印,但out不会前进。

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>"

编辑:在cnt.execute

之前忘记“SET”

2 个答案:

答案 0 :(得分:0)

逻辑看起来不错,除非我遗漏了什么。即使out没有被列为MS的保留字,我也不知道这是不是问题。

答案 1 :(得分:0)

找到它。 在out = cnt.execute(strSQL)

之前没有 SET

应该是

set out = cnt.execute(strSQL)