标题:分页最后一页不能显示的问题。。。
只看楼主
iamliubo
Rank: 1
等 级:新手上路
帖 子:357
专家分:0
注 册:2005-11-7
 问题点数:0 回复次数:1 
分页最后一页不能显示的问题。。。

我做的分页,前面都正常,但为什么点及最后一页或尾页的时候提示我:为什么啊?????
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/lyb/lyb.asp


<!--#include file="../conn.asp"-->
<%
page=request("page")
set lybrs=server.CreateObject("adodb.recordset")
lybrs.open"select*from lyb",conn,1,1
lybrs.pagesize=2
if page="" or page<=1 then
page=1
else
page=cint(page)
end if
if page>=lybrs.pagecount then
page=lybrs.pagecount
else
page=cint(page)
end if

if not lybrs.eof then
lybrs.absolutepage=page
For i =1 to lybrs.pagesize

%>
<table width="780" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="180" height="150" valign="top" class="lbg" bgcolor="#F1F7FE"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="180" height="150"><table width="170" border="0" align="center">
<tr>
<td><%=lybrs("names")%></td>
</tr>
<tr>
<td height="100" align="center" valign="middle"><%=lybrs("sex")%></td>
</tr>
<tr>
<td><%=lybrs("times")%></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="600" valign="top" class="rbg" bgcolor="#F1F7FE"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="31" colspan="2" valign="top" class="lastbg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="600" height="30"><div align="left"> <strong><%=lybrs("zt")%></strong></div></td>
</tr>
</table></td>
<td width="7"></td>
<td width="7"></td>
</tr>
<tr>
<td width="7" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="5" height="120">&nbsp;</td>
</tr>
</table></td>
<td height="5" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="593" height="5"></td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td width="578" rowspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="578" height="117" align="left" valign="top"><%=lybrs("neirong")%></td>
</tr>
</table></td>
<td height="115"></td>
<td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="7" height="116">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="1"></td>
<td></td>
</tr>
<tr>
<td height="1"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
</table>
<%
lybrs.movenext
next
%>
<table width="780" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="780" height="50" bgcolor="#F1F7FE"><div align="right">
<%
if page<=1 then
response.write"<font size='2'>首页&nbsp;&nbsp;</font>"
response.write"<font size='2'>上一页&nbsp;&nbsp;</font>"
else
response.write"<font size='2'><a href=lyb.asp?page=1>首页</a>&nbsp;&nbsp;</font>"
response.write"<font size='2'><a href=lyb.asp?page="&page-1&">上一页</a>&nbsp;&nbsp;</font>"
end if
if page>=lybrs.pagecount then
response.write"<font size='2'>下一页&nbsp;&nbsp;</font>"
response.write"<font size='2'>尾页&nbsp;&nbsp;</font>"
else
response.write"<font size='2'><a href=lyb.asp?page="&page+1&">下一页</a>&nbsp;&nbsp;</font>"
response.write"<font size='2'><a href=lyb.asp?page="&lybrs.pagecount&">尾页</a>&nbsp;&nbsp;</font>"
end if
response.write"</td></tr>"
end if
lybrs.close
set lybrs=nothing
%>

搜索更多相关主题的帖子: request include color file 记录 
2006-01-07 15:39
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
得分:0 
<%
lybrs.movenext
If lybrs.eof Then Exit For'加上这个试一下
next
%>

中国人的财富网:http://www..cn/
2006-01-07 17:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-41957-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.618610 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved