中国联通交话费送会员:if rs.eof then

来源:百度文库 编辑:高校问答 时间:2024/03/29 17:57:51
<%
dim conn,rs,sql,i,connstr
connstr="provider=microsoft.jet.oledb.4.0; data source="&server.MapPath("bookshop.mdb")
set conn=server.CreateObject("adodb.connection")
conn.open connstr
set rs=server.CreateObject("adodb.recordset")
sql="select id,bookname from book order by total"
rs.open sql,conn,1,1
%>
<html>
<head>
<title>销量排行榜</title>
<meta http-equiv="content-type"content="text/html;charset=gb2312">
</head>
<body bgcolor="#ffffff"text="#000000">
<table width="100%"border="0">
<tr bgcolor="#ffffff">
<td colspan="2"><font size="2" color="#ffffff"><img src="gif/ph.gif" width="170" height="25"></img></font></td>
</tr>
<%
rd.pagesize=10
for i=1 to rs.PageSize
if rs.eof then
end if
%>
<tr>
<td width="13%">
<div align="><font size="2"><%=i%></font></div></td>
<td width="87%"><a href="detail.asp?id=<%=rs("id")%>"target="blank"><font size="2"><%=rs("bookname")%></font></a></td>
</tr>
<%
rs.movenext
next
%>
</table>
</body>
</html>
个位大吓看一看到底哪里错了

应该把 if rs.eof then end if 改成 while not (rs.eof and rs.bof)

再写你的读取数据库的代码, 再才是 rs.movenext wend 参考ASP语言

while(untile).....wend 语句

if rs.eof then 后面怎么紧接着就是 end if?