非常SOS!!ASP分页问题,高分急寻!

zpwsz 2003-12-15 04:30:42
页面http://17flying.net/web/type.asp,在本地测试时,MaxPrePage=10中的10不管改为几,第二页都是从第十一条信息开始,这是怎么回事呀,页面的源文件http://www.17flying.net/web/type_2.txt,不知是不是SQL语句出错了,还是其它问题,小弟是刚学ASP的,现在又要得急,贴在ASP版的几天http://expert.csdn.net/Expert/topic/2561/2561341.xml?temp=.9012873,还是没人给出正确结果,实在没有办法,只好再贴一次!

  本着助人精神的高手们,帮小弟看看呀,源文件到底是错在哪??如果需要全站文件可发E到seezoo@17flying.net或QQ8041983。万分致谢!
关键代码:




------------------------------------------

<%
const MaxPrePage=10 '每页显示记录数
if (request.querystring("page")<>"") and (IsNumeric(request.querystring("page"))) then '检查页号
intPage=CLng(request.querystring("page"))
else
intPage=1
end if

strSql="select * from zkpick where picktype2="&CLng(request.querystring("type"))
if (request.querystring("type")<>"") and (IsNumeric(request.querystring("type"))) then '检查是否等级分类
inttype=CLng(request.querystring("type"))
strSql=strSql& " and picktype2="&CLng(request.querystring("type"))
else
strSql="select * from zkpick"
end if
strSql=strSql&" order by pickid desc"

%>
<%
Sub DisplayPagelinks(rs,intPage,intType) '页面导航条
if not(request.querystring("type")<>"") and (IsNumeric(request.querystring("type"))) then
response.write " 全部网站 共有"&rs.RecordCount&"个 "
else
response.write " "&typestr&" 共有"&rs.RecordCount&"个"
end if

if intPage>1 then
if intType<>0 then
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page=1""><font color='#666666'>首页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page="&intPage-1&"""><font color='#666666'>上一页</font></a> "
else
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page=1""><font color='#666666'>首页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page="&intPage-1&"""><font color='#666666'>上一页</font></a> "
end if
else
response.write "首页 "
response.write "上一页 "
end if

if intPage < rs.PageCount then
if intType<>0 then
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page="&intPage+1&"""><font color='#666666'>下一页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page="&rs.PageCount&"""><font color='#666666'>尾页</font></a> "
else
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page="&intPage+1&"""><font color='#666666'>下一页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page="&rs.PageCount&"""><font color='#666666'>尾页</font></a> "
end if
else
response.write "下一页 "
response.write "尾页 "
end if

'-------------------------------
End Sub
%>

...全文
49 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
vvfish119 2004-03-26
  • 打赏
  • 举报
回复
沙虫说得对,都没有记录了你还要输出当然会出错,
if rs.eof then exit do 或者
if rs.eof then exit for
seezoo 2004-03-26
  • 打赏
  • 举报
回复
up
bzscs 2003-12-16
  • 打赏
  • 举报
回复
我把MaxPrePage改成1或是10以内的数,到了第四页都出现错误,而改为10以上就不会有错误提示了,但第二页还是从第十条开始,(数据库中有23条信息)

前面3页是正常就对了呀,第4页的错误是因为到了rs的最后一个记录,你还要输出,当然会出错
zpwsz 2003-12-16
  • 打赏
  • 举报
回复
不是吧!还有人能发现问题在哪呀!
seezoo 2003-12-15
  • 打赏
  • 举报
回复
up

zpwsz 2003-12-15
  • 打赏
  • 举报
回复
沙虫,加了了一条之后还是不行,rs.move (xxxxyyyzzz-1)*maxprepage


不知哪位仁兄能留个QQ什么的,我们直接联系
zpwsz 2003-12-15
  • 打赏
  • 举报
回复
''把你的代码修改一下
''const MaxPrePage=1
''再看看
----------------------------------------------
我把MaxPrePage改成1或是10以内的数,到了第四页都出现错误,而改为10以上就不会有错误提示了,但第二页还是从第十条开始,(数据库中有23条信息)

错误提示:
------------------------
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

ADODB.Field 错误 '800a0bcd'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/web/type2_1.asp,行124

----------------------------第124行开始的代码
124  typestr=rs("picktype2")
125  select case typestr
126 case 1: typestr="个人主页"
127 case 2: typestr="班级主页"
128 case 3: typestr="社团主页"
129 case 4: typestr="校外站点"
139 case else: typestr="校外站点"
zpwsz 2003-12-15
  • 打赏
  • 举报
回复
连接数据那不分内容
<%
set rs=createobject("adodb.recordset")
rs.open strSql,conn,1,1
if request("page")<>"" then
xxxxyyyzzz=cint(request("page"))
else
xxxxyyyzzz=1
end if

if rs.eof and rs.bof then
response.write "<div align='center'><font color='#ff0000'>此类暂时还没有相关的认证网站,欢迎您的加入!</font></div>"
else
rs.absolutepage=xxxxyyyzzz

rs.pagesize=MaxPrePage
if intPage>rs.pagecount then
intPage=rs.pagecount
end if %>
qwater 2003-12-15
  • 打赏
  • 举报
回复
页面刷新问题?
浏览器设置,自动更新
bzscs 2003-12-15
  • 打赏
  • 举报
回复
if request("page")<>"" then
xxxxyyyzzz=cint(request("page"))
else
xxxxyyyzzz=1
end if
rs.move (xxxxyyyzzz-1)*maxprepage
bzscs 2003-12-15
  • 打赏
  • 举报
回复
把你的代码修改一下
const MaxPrePage=1
再看看
zpwsz 2003-12-15
  • 打赏
  • 举报
回复
连接数据库那部分和这分关系吗?出于安全考虑,仁兄您若需在的话,我可以给你发了EMAIL中
<!--#include file="dbinc/dbpath.asp" -->
angelheavens 2003-12-15
  • 打赏
  • 举报
回复
连接数据那不分内容也帖出来

28,405

社区成员

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

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