报错信息是这样:错误类型:ADODB.Recordset (0x800A0CB3)当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制.请问这是怎么回事,我是在分页的时候出现的(asp+sql),就是这段代码rs_Read.AbsolutePage =Cint(page)请高手指点,小弟很急

解决方案 »

  1.   

    代码如下<html>
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title></title>
    <link rel="stylesheet" href="../CSS/M_style.css" type="text/css"></head>
    <script language="JavaScript">
    <!--
    function CheckAll(form)
    <!--
    {
      for (var i=0;i<form.elements.length;i++)
        {
        var e = form.elements[i];
        if (e.name != 'chkall')
           e.checked = form.chkall.checked;
        }
      }function cf()
    {
    if(confirm("你真的要删除吗?"))
    window.del.submit();
    else
    window.focus();
    }function jump(url)
    {
    window.navigate(url);
    }
    -->
    </script>
    <script language="JavaScript">
    <!--
    function view(newsfile) { var gt = unescape('%3e');
    var popup = null;
    var over = "Launch Pop-up Navigator";
    popup = window.open('', 'popupnav', 'width=600,height=420,resizable=1,scrollbars=yes');
    if (popup != null) {
    if (popup.opener == null) {
    popup.opener = self;
    }
    popup.location.href = newsfile;
    }
    }function view2(newsfile) { var gt = unescape('%3e');
    var popup = null;
    var over = "Launch Pop-up Navigator";
    popup = window.open('', 'popupnav', 'width=280,height=160,resizable=1,scrollbars=yes');
    if (popup != null) {
    if (popup.opener == null) {
    popup.opener = self;
    }
    popup.location.href = newsfile;
    }
    }
    // -->
    </script>
    <body leftmargin="0" topmargin="0">
      <table border=0 cellpadding=0 cellspacing=0 class=tb2>
      <TR> 
        <td> 
          <table  border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=100% style="border-collapse: collapse">
              <% 
     page=request.querystring("page")
      if page="" then
      page=1
      end if 
      pages = 1
    set rs_topic = server.createobject("adodb.recordset") 
    sql1 = "NEW_LIST"
    rs_topic.open sql1,conn,1,1
    if not(rs_topic.BOF or rs_topic.EOF) then
    rs_topic.pagesize = pages 
    maxpagecount=rs_topic.pagecount
    r=cint(rs_topic.RecordCount)'记录总数
    rs_topic.absolutepage = page '当前页数
    rcount=0
    pagestart=page-5
    pageend=page+5
    if pagestart<1 then
    pagestart=1
    end if
    if pageend>maxpagecount then
    pageend=maxpagecount
    end if
     %>
              <% do while not rs_topic.eof and rcount <rs_topic.pagesize%>
              <% rs_topic.MoveNext 
    rcount=rcount+1
    loop 
    %>
              <tr  align="left" height=23> 
                <td colspan="7" bgcolor=<%=tColor2%> class=tdc > <a href=list.asp?l_id=<%=request.querystring("l_id")%>&page=1><<</a> 
                  <% for i=pagestart to pageend
                if i=0 then 
                i=1
                end if
                strurl="<a href=?l_id="&request.querystring("l_id")&"&page="&i&">["
                if i=cint(page) then
                 strurl=strurl&"<font size=4><b>"&i&"</b></font>"
                  else
                  strurl=strurl&i 
                  end if
                  strurl=strurl&"]</a>"
                 
                response.write strurl
    response.write " "
     next
                %>
                  <a href=default.asp?l_id=<%=request.querystring("l_id")%>&page=<%=maxpagecount%>>>></a> 
                  ..</td>
              </tr>
              <%else%>
              <tr  align="center" height=23> 
                <td colspan="7" bgcolor=<%=tColor2%> class=tdc >暂无主题</td>
              </tr>
              <%
    end if
    rs_topic.close 
    set rs_topic=nothing
    %>
            </table>
        </td>
      </tr>
    </table>  </center><div align="center">
      <center></td></tr>
        </table> 
      </center>
    </div>
    </body></html>
      

  2.   

    我只是读资料的时候select 语句写成存储过程.但是就是出现问题rs_topic.absolutepage = page 这句,
    如果我直接把select写在页面里面就可以.请指点
      

  3.   

    改成;rs_topic.open sql1,conn,3,3试试
      

  4.   

    你把
    page=request.querystring("page")
      if page="" then
      page=1
      end if 改成:if not isempty(request("page")) and request("page")<>"0" then
    page=request("page")
    else
             page=1
    end if试试
      

  5.   

    其实不是在page的问题,如果我把存储过程改成直接写select 的话就可以,但是我把select 写到存储过程中就不行了,报错就在这行rs_topic.absolutepage = page  错误类型:
    ADODB.Recordset (0x800A0CB3)
    当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制.
    请指点
      

  6.   

    先设置好属性再打开可以解决,不过最好还是用id然后select top 这样的语句取分页最快========
    欢迎使用www.bz2008.com 可以辅助生成大部分的程序代码,注册即可使用
    支持所有开发语言和平台
      

  7.   

    如果 new_list是存储过程名
    sql1 = "NEW_LIST"
    改成 sql1="(exec new_list)" 试试
      

  8.   

    http://book.77169.org/ask17/how102406.htm