我做的分页,前面都正常,但为什么点及最后一页或尾页的时候提示我:为什么啊?????
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"> </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"> </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'>首页 </font>"
response.write"<font size='2'>上一页 </font>"
else
response.write"<font size='2'><a href=lyb.asp?page=1>首页</a> </font>"
response.write"<font size='2'><a href=lyb.asp?page="&page-1&">上一页</a> </font>"
end if
if page>=lybrs.pagecount then
response.write"<font size='2'>下一页 </font>"
response.write"<font size='2'>尾页 </font>"
else
response.write"<font size='2'><a href=lyb.asp?page="&page+1&">下一页</a> </font>"
response.write"<font size='2'><a href=lyb.asp?page="&lybrs.pagecount&">尾页</a> </font>"
end if
response.write"</td></tr>"
end if
lybrs.close
set lybrs=nothing
%>