sql数据库的循环问题

来源:百度知道 编辑:UC知道 时间:2024/07/02 17:46:57
用ACCESS数据库的时候都可以:
SQL="Select * From [admin]"
Rs.open sql,conn,1,1
if not rs.eof then
while not rs.eof
response.write rs("username")
wend
rs.movenext
但现在改用SQL数据库了,就不能这样循环读出数据了吗???
那应该如何写呢????

写法是一样的,你把rs.movenext放错了位置,改到while里面就行了,修改如下:

SQL="Select * From [admin]"
Rs.open sql,conn,1,1
if not rs.eof then
while not rs.eof
response.write rs("username")
rs.movenext
wend