求助????

myr0917 2005-07-25 09:00:56
<body>
<%

'response.write x
x=request("x")

Set rs1=Server.CreateObject("ADODB.Recordset")
sql="select * from wenzhang where type='"&x&"'"
rs1.Open sql,Conn,1,1

rs1.PageSize=2
Page=1
if Not IsEmpty(Request("Page")) then '如果PAGE已经初始化...
Page = CInt(Request("Page")) '接
if Page > rs1.PageCount then '如果接收的页数大于总页数
rs1.AbsolutePage = rs1.PageCount '设置当前显示页等于最后页

elseif Page <= 0 then '如果page小于等于0
Page = 1 '设置PAGE等于第一页
else
rs1.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
end if
End if
%>
<% For i = 1 to rs1.PageSize
if rs1.EOF then
Exit For
end if '利用for next 循环依次读出记录
%>
<table width="560" border="0" cellpadding="0" cellspacing="0">

<tr>
<td width="171" height="35" valign="top"><%=rs1("id")%></td>

<td width="185" valign="top"><a href="show1.asp?m=<%=rs1("title")%>"><%=rs1("title")%></a></td>
<td width="204" valign="top"><%=rs1("content")%></td>
</tr>
</table>

<%
rs1.movenext
next


%>
共有<% =rs1.RecordCount %>篇<% =rs1.PageCount%>页
<a href="show.asp?Page=<%=1%>"> 首页</a> <a href="show.asp?Page=<%=Page-1 %>">上页</a>
<%if request("Page")<>rs1.pagecount and page<rs1.pagecount then %>
<a href="show.asp?Page=<%=Page+1%>">下页</a>
<%end if%>
<a href="show.asp?Page=<%=rs1.PageCount%>">尾页</a> 当前第<%=Page%>页
<%
rs1.close
set rs1=nothing
Conn.close
set Conn=nothing

%>

</body>

报的错是这句话请大家看看 错误代号是ox800A0BB9
if Page > rs1.PageCount then '如果接收的页数大于总页数
rs1.AbsolutePage = rs1.PageCount '设置当前显示页等于最后页

...全文
46 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ljqhbt 2005-07-25
  • 打赏
  • 举报
回复
你没有设置页的大小

用分页程序,不要用ADO的分页.

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧