告急哦,分页问题!高手快进!

NetBoy 2003-08-20 06:10:16
给家公司写了小程序,结果查询页面分页时总提示Recordset错误,晕,其它直接sql语句分页完全正常,哪位指点一下。急用啊!
...全文
70 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
NetBoy 2003-09-11
  • 打赏
  • 举报
回复
谢谢两位的帮助,按Luckyji(壹)的解释,我找到了错误之所在,现在问题已经解决了,谢谢两位,分数不多,请笑纳。
hengxin54 2003-08-20
  • 打赏
  • 举报
回复
把rs.pagesize=16移到判断后面,应该是这句出错吧
Luckyji 2003-08-20
  • 打赏
  • 举报
回复
一个分页的,可以看一下,!


<head>
<title>商业机会</title>
<LINK rel="stylesheet" href="css/index.css" type="text/css">
<script language="javascript" src="js/window.js"></script>

</head>
<!--#include file="conna.asp"-->
<!-- #include file="top.htm" -->
<CENTER>
<%
set rs=server.createobject("adodb.recordset")
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
sql="select * from pub order by id desc"
rs.open sql,conn,1,1
rs.PageSize=16
if rs.eof and rs.bof then
response.write " <FONT COLOR='#000066'>对不起,没有符合要求的记录!</FONT>"
response.write " <P><CENTER><A HREF='javascript:history.go(-1)'>点此返回</CENTER></A>"
response.end
end if
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
rs.AbsolutePage=pagecount
dim i
i=0 %>
<% response.write"<form method=Post action='bus.asp?key="+key+"'>"
response.write "<font color='#000064'>◆ </font>"
if PageCount=1 then
response.write "<font color='#000064'>首页 上一页</font> "
else
response.write "<a href=bus.asp?page=1&key="+key+"><font color='0000BE'>首页</font></a> "
response.write "<a href=bus.asp?page="+cstr(pagecount-1)+"&key="+key+"><font color='0000BE'>上一页</font></a> "
end if
if rs.PageCount-pagecount<1 then
response.write "<font color='#000064'>下一页 尾页</font>"
else
response.write "<a href=bus.asp?page="+cstr(pagecount+1)+"&key="+key+"><font color='0000BE'>下一页</font></a> "
response.write "<a href=bus.asp?page="+cstr(rs.PageCount)+"&key="+key+"><font color='0000BE'>尾页</font></a>"
end if
response.write "<font color='000064'> 共"&rs.recordcount&"条记录 "&rs.PageSize&"条记录/页</font>"
response.write "<font color='000064'> 页码:<font color=blue>"&PageCount&"</font>/"&rs.PageCount&"页</font>"
response.write "<font color='000064'> 转到第<input type='text' name='page' size=2 class=smallInput style='font-size: 9pt; color: rgb(0,0,255)' value="&PageCount&">页</font> "
response.write "<input class=buttonface type='submit' value='确 定' name='cndok' style='font-family: 宋体; font-size: 9pt; color: #000073'>" %></CENTER>
<br>
<div align="center">
<center>
<table border="1" cellpadding="0" width="732" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#DBDBDB" cellspacing="0" height="28">
<% do while not rs.eof %>
<tr>
<% for i = 1 to 4 %>
<td width="25%" align="center" height="25"> <A HREF="javascript:openwin('view_opp.asp?id=<%=rs("id")%> ')"><%=rs("p_id") %></A></td>
<%
rs.movenext
if rs.eof then
exit for
end if
next%>
</tr>

<% i=i+1

if i>=rs.PageSize then exit do
loop
rs.close
set rs=nothing
conn.close
set conn=nothing %>
</table>
</div>
</form>
<!-- #include file="bottom.htm" -->
奇玉 2003-08-20
  • 打赏
  • 举报
回复
把原程序拿来看看
NetBoy 2003-08-20
  • 打赏
  • 举报
回复
up,没人理,不会吧!哪位仁兄帮帮忙,先谢谢了!!

28,390

社区成员

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

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