为何在2003下面使用分页技术,会有这种情况'800a0cb3' 记录集不支持书签
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>