古代代表凶兆的星象:下面的代码有什么问题,谁知道的?

来源:百度文库 编辑:高校问答 时间:2024/04/27 14:27:58
下面输出的竟是同样的记录.而且序号都是一样的.
为什么?不知道哪里错了?

<form action=delmusic.asp?action=delmusic method=post name=delmusic>
<%
dim songname,singer,special,adddate,k,i,x
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from musiclist",conn,1,1
songname=rs("songname")
singer=rs("singer")
adddate=rs("adddate")
special=rs("special")
x=rs.recordcount
for i=1 to x
do while not rs.eof
%>
<tr>
<td width="47"><p align="center"><span style="font-size: 9pt"><%=i%></span>
</td>
<td width="7"><span style="font-size: 9pt"> </span></td>
<td width="161"><span style="font-size: 9pt"><%=songname%></span></td>
<td width="11"><span style="font-size: 9pt"> </span></td>
<td width="69"><span style="font-size: 9pt"><%=singer%> </span></td>
<td width="7"><span style="font-size: 9pt"> </span></td>
<td width="126"><span style="font-size: 9pt"> <%=special%></span></td>
<td width="11"><span style="font-size: 9pt"> </span></td>
<td width="183"><span style="font-size: 9pt"> <%=adddate%></span></td>
<td width="6"><span style="font-size: 9pt"> </span></td>
<td width="48">
<p align="center"><input type="checkbox" name="C1" value="ON"></form>
</td>
</tr>
<%
rs.MoveNext
loop
next
rs.close
set rs=nothing
%>
</from>

你把这些
songname=rs("songname")
singer=rs("singer")
adddate=rs("adddate")
special=rs("special")
放到do while not rs.eof 后面就可以了。

只读一次,然后这些变量内容就再没变过……

你好像搞了个多重循环,更晕的是你在循环之前就把记录取出来了,呵呵
把songname=rs("songname")
singer=rs("singer")
adddate=rs("adddate")
special=rs("special")
放在循环体里就不会完全一样了!

rs.movefirst'********MOVE FIRST 很重要`
if not rs.eof 0r not rs.eof then
循环`
else
error
end if
如果你做分页的话`