我学作分页显示,它只显示第一页和第二页就不显示了(共5条记录,我一页显示一条)
<%
set conn=server.CreateObject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("shuju.mdb")
sql="select * from lr order by rdate"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
%>
<div align="center"><!-- #BeginLibraryItem "/Library/bbstop.lbi" --><img src="image/top1.gif" width="800" height="135"><!-- #EndLibraryItem -->
<table width="800" border="1" cellpadding="0" cellspacing="0" class="thin">
<tr>
<td height="30" background="../../image/zhuo-1.gif"><div align="center"><span class="style1">心 情 日 记</span></div></td>
</tr>
<tr>
<td height="20"><div align="right"> [<a href="../../index.htm" target="_blank">烽中网</a>] [<a href="insert.asp">留言</a>] [<a href="top.asp">查看</a>] [管理] </div></td>
</tr>
<tr>
<td class="thin">
<% if rs.recordcount>0 then
ls=1
rs.pagesize=cint(ls)
zy=rs.pagecount
pageno=request("pageno")
if pageno="" then
pageno=1
end if
sa=request("coms")
if sa="上一页" then
pageno=pageno-1
if pageno<1 then
pageno=1
end if
end if
if sa="下一页" then
pageno=pageno+1
end if
rs.absolutepage=pageno
rc=cint(ls)
do while not rs.eof and rc>0
%>
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="thin" frame="void">
<tr>
<td width="100"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><img src="tuox/<%=rs("icon")%>.gif" width="45" height="54"></div></td>
</tr>
<tr>
<td><div align="center"><%response.Write rs("name")%></div></td>
</tr>
</table></td>
<td valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" class="thin" frame="void">
<tr>
<td width="100" height="15"><div align="center">访客发表于:</div></td>
<td><div align="left"><%response.Write rs("date")%></div></td>
<td width="50"><div align="center">[<a href="mailto:<%=rs("email")%>">邮箱</a>]</div></td>
</tr>
<tr>
<td width="100"><div align="center">日记内容 :</div></td>
<td colspan="2"><div align="left"><%response.Write rs("text")%></div></td>
</tr>
<tr>
<td width="100" rowspan="2"><div align="center">回复内容 : </div></td>
<td colspan="2"><div align="left"><%response.Write rs("rtext")%></div></td>
</tr>
<tr>
<td colspan="2"><div align="right"><%response.Write rs("rdate")%></div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#00CCFF">
<td height="10" colspan="2"> </td>
</tr>
</table>
<% rc=rc-1
rs.movenext
loop
else %>
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="thin">
<tr>
<td><div align="center">还没有人留言。</div></td>
</tr>
</table>
<% end if%>
</td>
</tr>
<tr>
<td height="20"><div align="right">
<form method='get' action="top.asp">
共<%=zy%>页 <%=rs.recordcount%>条记录
<% if pageno>1 then
response.write"<input type='submit' name='coms' with='40' value='上一页'>"
end if
if pageno<zy then
response.write"<input type='submit' name='coms' with='40' value='下一页'>"
end if %>
</form>
</div></td>
</tr>
<tr>
<td height="20"><div align="center">维护©烽中人</div></td>
</tr>
</table>
</div>
<% conn.close
set conn=nothing
%>
</body>
</html>