| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 423 人关注过本帖
标题:[求助]请大家看下absolutepage问题,谢谢了
只看楼主 加入收藏
fengjian
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-7-29
收藏
 问题点数:0 回复次数:1 
[求助]请大家看下absolutepage问题,谢谢了

<!--#include file="include/conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员查询</title>
<link href="css/yangshi.css" rel="stylesheet" type="text/css">
<!--#include file="top.asp"-->
<!--#include file="include/function.asp"-->
<%
if session("powerss")<>1 and session("powerss")<>2 then
response.Redirect "admin_manage.asp"
response.End()
end if
i=request.Form("num")
radio=request.Form("radiobutton")
checkname=request.Form("check")
check=split(checkname,",")
if radio="" or check(i)="" then
response.Redirect "admin_bo_checkborrow.asp"
response.End()
end if
dim sqlstr
select case cint(radio)
case 1
sqlstr="select * from book_borrow where stunum='"&check(i)&"'"
case 2
sqlstr="select * from book_borrow where booknum='"&check(i)&"'"
end select
'survey(sqlstr)
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,3,1

filename="admin_ac_checkborrow.asp"
pageno=cint(request("pageno"))
rs.pagesize=5
recordcount=rs.recordcount
pagecount=cint(rs.pagecount)
if pageno>=pagecount then
pageno=pagecount
end if
if IsEmpty(pageno) or pageno<1 then
pageno=1
end if
'response.Write pageno
'response.Write recordcount
'response.Write pagecount
'response.Write rs.pagesize
'response.End()
rs.absolutepage=pageno '提示这里错误.错误类型:ADODB.Recordset (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

%>
<table width="40%" border="0" align="center">
<tr>
<td><div align="center" class="style4">查询结果</div></td>
</tr>
</table>
<table width="80%" height="26" border="0" align="center">
<tr bgcolor="#FFDAB9">
<td><div align="center">书号</div></td>
<td><div align="center">书名</div></td>
<td><div align="center">学生号</div></td>
<td><div align="center">学生名</div></td>
<td><div align="center">借阅日期</div></td>
</tr>
</table>
<%
do while not rs.eof
sqlstr1="select * from book_borrow where booknum='"&check(i)&"'"
response.Write sqlstr1
'response.End()
stunum=rs("stunum")
sqlstr2="select * from stu_info where stunum='"&stunum&"'"
set cs=server.CreateObject("adodb.recordset")
cs.open sqlstr2,conn,1,1
response.Write sqlstr2
'response.End()
%>
<table width="80%" height="26" border="0" align="center">
<tr bgcolor="#FFDAB9">
<td width="15%" bgcolor="#E3F1D1"><div align="center"><%=rs("booknum")%></div></td>
<td width="15%" bgcolor="#F4FAED"><div align="center"><%=rs("bookname")%></div></td>
<td width="21%" bgcolor="#F4FAED"><div align="center"><%=rs("stunum")%></div></td>
<td width="21%" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="center"><%=cs("stuname")%></div></td>
<td width="28%" bgcolor="#FFFFFF"><div align="center"><%=rs("borrow_date")%></div></td>
</tr>
</table>
<%
rs.movenext
loop
cs.close
set cs=nothing
rs.close
set rs=nothing
%>
<table width="80%" border="0" align="center">
<tr>
<td><div align="right"><%call page(filename,pageno,pagecount)%></div></td>
</tr>
</table>
我用response.write输出pageno,pagecount都没问题,请帮看看吧~头都大了~谢谢了!!

搜索更多相关主题的帖子: absolutepage 
2007-05-13 18:19
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 
回复:(fengjian)[求助]请大家看下absolutepage问题...

<!--#include file="include/conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员查询</title>
<link href="css/yangshi.css" rel="stylesheet" type="text/css">
<!--#include file="top.asp"-->
<!--#include file="include/function.asp"-->
<%
if session("powerss")<>1 and session("powerss")<>2 then
response.Redirect "admin_manage.asp"
response.End()
end if
i = request.Form("num")
radio = request.Form("radiobutton")
checkname = request.Form("check")
check = split(checkname,",")
if radio="" or check(i)="" then
response.Redirect "admin_bo_checkborrow.asp"
response.End()
end if
dim sqlstr
''这里最好给radio赋一个默认值,就的当radio不等与1或者2时,默认赋1或者2,以确保sqlstr不为空,如:
If radio <> 1 And radio <> 2 Then radio = 1
select case cint(radio)
case 1
sqlstr = "select * from book_borrow where stunum='"&check(i)&"'"
case 2
sqlstr = "select * from book_borrow where booknum='"&check(i)&"'"
end select
'survey(sqlstr)
set rs = server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,3,1

filename = "admin_ac_checkborrow.asp"
pageno = cint(request("pageno"))
''判断是否查询到了符合条件的记录
If Not Rs.Eof Then
rs.pagesize = 5
recordcount = rs.recordcount
pagecount = cint(rs.pagecount)
if pageno>=pagecount then
pageno = pagecount
end if
if IsEmpty(pageno) or pageno<1 then
pageno = 1
end if
'response.Write pageno
'response.Write recordcount
'response.Write pagecount
'response.Write rs.pagesize
'response.End()
'提示这里错误.错误类型:ADODB.Recordset (0x800A0BCD)BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
rs.absolutepage = pageno
%>
<table width="40%" border="0" align="center">
<tr>
<td><div align="center" class="style4">查询结果</div></td>
</tr>
</table>
<table width="80%" height="26" border="0" align="center">
<tr bgcolor="#FFDAB9">
<td><div align="center">书号</div></td>
<td><div align="center">书名</div></td>
<td><div align="center">学生号</div></td>
<td><div align="center">学生名</div></td>
<td><div align="center">借阅日期</div></td>
</tr>
</table>
<%
do while not rs.eof
sqlstr1="select * from book_borrow where booknum='"&check(i)&"'"
'response.Write sqlstr1
'response.End()
stunum = rs("stunum")
sqlstr2 = "select * from stu_info where stunum='"&stunum&"'"
set cs = server.CreateObject("adodb.recordset")
cs.open sqlstr2,conn,1,1
'response.Write sqlstr2
'response.End()
%>
<table width="80%" height="26" border="0" align="center">
<tr bgcolor="#FFDAB9">
<td width="15%" bgcolor="#E3F1D1"><div align="center"><%=rs("booknum")%></div></td>
<td width="15%" bgcolor="#F4FAED"><div align="center"><%=rs("bookname")%></div></td>
<td width="21%" bgcolor="#F4FAED"><div align="center"><%=rs("stunum")%></div></td>
<td width="21%" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="center"><%=cs("stuname")%></div></td>
<td width="28%" bgcolor="#FFFFFF"><div align="center"><%=rs("borrow_date")%></div></td>
</tr>
</table>
<%
rs.movenext
''这个最好放这位置,如果没有执行DO循环cs就不会创建,关闭就会出错
cs.close
set cs = nothing
loop
%>
<table width="80%" border="0" align="center">
<tr>
<td><div align="right"><%call page(filename,pageno,pagecount)%></div></td>
</tr>
</table>
<%
Else
%>
<table width="80%" border="0" align="center">
<tr>
<td><div align="right">没有查询到符合条件的记录</div></td>
</tr>
</table>
<%
End If
rs.close
set rs=nothing
%>

没有测试,仅提供参考!

专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-05-14 09:12
快速回复:[求助]请大家看下absolutepage问题,谢谢了
数据加载中...
 
   



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

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