为何在2003下面使用分页技术,会有这种情况'800a0cb3' 记录集不支持书签

BOY_ZC 2005-11-20 11:33:01
1-1-1

ADODB.Recordset 错误 '800a0cb3'

当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制。

/test2.asp,行 44



对这个页面调用
我一开始使用的是
test2.asp?id=1212

代码如下

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>

<p>
<%
dim rs
id=request.QueryString("id")
sql2="SELECT * from pub_news where news_class_id='" & id & "'"
set conn1=server.createobject("ADODB.connection")
conn1.open "PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=db1;"
Set rs=server.createobject("adodb.recordset") '连接数据库

rs.open sql2,conn1,3,3 '返回数据集

if rs.pagecount=0 then
response.write "<script>alert('对不起,还没有任何记录');history.back();</Script>"
response.end
else
if request("textpage")="" then
page=1
else
page=int(request("textpage"))
end if

rs.pagesize=5
total=rs.pagecount
bishu=rs.recordcount
if int(page)<1 then page=1 end if
Response.Write(page)
if page>rs.pagecount then page=rs.pagecount end if

Response.Write(page)'<==我在这里输出则么变成-1


Response.Write(rs.pagecount)

rs.absolutepage=1 '<===这里是44行
%>
以下是要列出信息的表格</p>




'下面是翻页的信息
if page<>1 then
response.write ( "<a href=test2.asp?flag=1&id="&id&"&textpage="&(1)&">第一页</a> ")
response.write (" <a href=test2.asp?flag=1&id="&id&"&textpage="&(page-1)&">上一页</a>")
end if
if page<>total then
response.write("<a href=test2.asp?flag=1&id="&id&"&textpage="&(page+1)&">上一页</a>")
response.write("<a href=test2.asp?flag=1&id="&id&"&textpage="&(rs.pagecount)&">最后页</a>")
end if
%>
</td>
<td valign="bottom">   跳到:</td>
<td valign="bottom">
<input type="text" name="textpage" value="<%=page%>" size="1">
<input type="hidden" name="flag" value="1"> <input type="submit" value="确定">

</form>
</table>
<% end if


%>
</body>
</html>
...全文
96 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
rs.open sql,conn,1,1
TSD 2006-05-08
  • 打赏
  • 举报
回复
id=request.QueryString("id")

这个需要做些过滤,防止注入!
itzhiren 2006-05-08
  • 打赏
  • 举报
回复
rs.open sql2,conn1,3,1
Swanzy 2006-05-08
  • 打赏
  • 举报
回复
RS.CursorLocation = 3
BOY_ZC 2005-11-21
  • 打赏
  • 举报
回复
有谁知道吗?
BOY_ZC 2005-11-21
  • 打赏
  • 举报
回复
请指教

28,406

社区成员

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

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