首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

小弟我的代码中加上这条语句"myconn.absolutepage=pageNum"就会报错,请教该怎么处理?多谢

2012-03-12 
我的代码中加上这条语句myconn.absolutepagepageNum就会报错,请问该怎么办?谢谢报错的内容:ADODB.Recor

我的代码中加上这条语句"myconn.absolutepage=pageNum"就会报错,请问该怎么办?谢谢
报错的内容:
ADODB.Recordset   错误   '800a0cb3 '  
当前   Recordset   不支持书签。这可能是提供者或选定的光标类型限定的。  

我的代码:
<%
<!--#include   file= "Connections/gym.asp "   -->
public   myDSN
Set   myDSN=Server.CreateObject( "ADODB.connection ")
'connStr= "DBQ= "+server.mappath( "dbdata.mdb ")+ ";DRIVER={Microsoft   Access   Driver   (*.mdb)};DriverId=25;FIL=MS   Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes; "
'myDSN.Open   connStr
'myDSN.Open   gym_conn,3,2

pageSize=9
      if   request( "pagenum ")= " "   then
          pageNum=1
      else
          pageNum=CInt(request( "pagenum "))
      end   if    
      fileName=split(request.ServerVariables( "URL "), "/ ")
      pageName=fileName(UBound(fileName))& "? "
      classID=CInt(request( "classID "))
      classSuperID=CInt(request( "classSuperID "))
     
%>
<%   sub   newsList(classID,classSuperID)   %>

<style   type= "text/css ">
.list   {
font-size:   12px;
color:   #7C7C7C;
text-decoration:   none;
}
.font5   {
font-size:   12px;
color:   #666666;
text-decoration:   none;
}
</style>
<table   width= "568 "   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
                                        <tr>
                                            <td   height= "22 "   valign= "top "   style= "background-repeat:no-repeat;background-position:0cm   0.05cm "   align= "right "   id= "topBar "   class= "fon5 "> </td>
                                        </tr>
                                        <tr>
                                            <td   valign= "top ">
<TABLE   width=95%   border=0   align= "center "   cellPadding=2   cellSpacing=0>
    <tr>  
                                    <td   height= "7 "> </td>
                </tr>
<tr>
<td>  
<%   set   myconn=server.createobject( "adodb.recordset ")
      mysql= "SELECT   newsID,newsTitle,newsTime,img   FROM   newsAll   WHERE   classID= "&classID& "   ORDER   BY   newsTime   DESC "


      myconn.open   mysql,gym_conn,3,2
     
     

     
     
     
      if   not   myconn.eof   then  
          myconn.pagesize=pageSize
          pageCount=myconn.pagecount
          recordCount=myconn.recordcount
          myconn.absolutepage=pageNum       ‘就是这条语句,一加上就报错
  rowCount=1
          do   while   not   myconn.eof   and   rowCount <=pageSize
%>                            
                               
                                  <a   href=
    "../third/detail.asp?newsID= <%=myconn( "newsID ")%> &classID= <%=classID%> &classSuperID= <%=classSuperID%> "
                            target= "_blank "   class= "list "> <img   src= "upload/ <%=myconn( "img ")%> "   width= "150 "   height= "120 "   border= "0 "   class= "pic "> </a>                                  

<%           myconn.movenext
              rowCount=rowCount+1
          loop
      else  
%>  
        </td>                                
                                </tr>                      
                               
<tr>  
                                    <td   height=30   align=center> &Ocirc;&Yacute;&Icirc;&THORN;&Auml;&Uacute;&Egrave;&Yacute;&pound;&iexcl; </td>
                                </tr>
<%   end   if  
      myconn.close      
      set   myconn=nothing
%>                                
                                    </table>
                                </td>
                            </tr>
                           


                            <tr>  
                                <td   height= "24 "   background= "../images/huabei2.gif "   style= "background-repeat:no-repeat;background-position:0.8cm   0cm "   id= "bottomBar "   class= "fon5 "   align= "right "   > <span   class= "list ">
                                    <%   call   makeNavigator(pageNum,pageCount,recordCount,pageName)%>
                                &nbsp; </span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
                            </tr>
                            <tr>  
                                <td   height= "5 "> <script> topBar.innerHTML=bottomBar.innerHTML; </script> </td>
                            </tr>
</table>
<%   end   sub   %>

[解决办法]
<% set myconn=server.createobject( "adodb.recordset ")
mysql= "SELECT newsID,newsTitle,newsTime,img FROM newsAll WHERE classID= "&classID& " ORDER BY newsTime DESC "
myconn.open mysql,gym_conn,3,2 ---------> myconn.open mysql,gym_conn,3,1
try it

热点排行