flower vocaloid:帮我看一下这段代码,哪里错了?

来源:百度文库 编辑:高校问答 时间:2024/04/27 15:11:03
我初学者,多指教.先谢谢了

下面我想实现的是数据库某个表中的前3组信息,但是出来的效果虽然是3组信息,不过都是同一条.一样的,为什么?我看别人似乎都是这样做的呀,帮我看看哪里错了.

<table border="0" width="174" height="73" cellspacing="0" cellpadding="0">
<tr>
<td width="5" height="3"></td>
<td height="6" bgcolor="#E34545"></td>
</tr>
<tr>
<td width="6" bgcolor="#E34545"> </td>
<td width="168" bgcolor="#F1D9D9">

<%dim singer,songname,special,rs3,i
set rs3=server.CreateObject("adodb.recordset")
rs3.Open "select top 3 songname,singer from musiclist",conn,1,1
songname=trim(rs3("songname"))
singer=trim(rs3("singer"))
%>
<table border="0" width="100%" height="100%">
<%i=1
do while not rs3.eof%>
<tr>
<td>
<p><font color="#660033" style="font-size:9pt"> <%=songname%> - <%=singer%></font></p>
</td>
</tr>
<%i=i+1
if i>3 then exit do
rs3.movenext
loop
rs3.close
set rs3=nothing%>
</table>

</td>
</tr>
<tr>
<td width="5" height="4"></td>
<td height="6" bgcolor="#E34545"></td>
</tr>
</table>

songname=trim(rs3("songname"))
singer=trim(rs3("singer"))

这个放在 do循环的里面

do while not rs.eof

songname=trim(rs3("songname"))
singer=trim(rs3("singer"))
.............code............
rs.movenext

这是什么编程
我只会VB