打印

[asp] ASP分页代码错误,望指点迷津

小弟出来乍到,望大家不吝赐教!
代码如下:
<%
dim lx,sql,rs,pageno,MaxPerPage,mpage,pno,currentPage,totalPut,showpage,i,j,k,totalnumber
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
   MaxPerPage=100 '###每页显示条数
   
lx="文章"
sql = "select * from txt where memo like '%" & lx & "%' order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof

totalPut=rs.recordcount                                                         
        if currentpage<1 then                                                         
          currentpage=1                                                         
      end if                                                         
      if (currentpage-1)*MaxPerPage>totalput then                                                         
          if (totalPut mod MaxPerPage)=0 then                                                         
            currentpage= totalPut \ MaxPerPage                                                         
          else                                                         
             currentpage= totalPut \ MaxPerPage + 1                                                         
          end if                                                         
      end if                                                         
       if currentPage=1 then                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
            showContent                                                         
            showpage totalput,MaxPerPage,"index.asp"                                                         
       else                                                         
          if (currentPage-1)*MaxPerPage<totalPut then                                                         
            rs.move  (currentPage-1)*MaxPerPage                                                         
            dim bookmark                                                         
            bookmark=rs.bookmark                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
            showContent                                                         
             showpage totalput,MaxPerPage,"index.asp"                                                         
        else                                                         
               currentPage=1                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
           showContent                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
             end if                                                         
          end if                                                         
       sub showContent                                                         
       dim i                                                         
       i=0                                                         
end sub                                                        
function showpage(totalnumber,maxperpage,filename)                                                      
end function                                                      
  dim n                                                        
  if totalnumber mod maxperpage=0 then                                                        
     n= totalnumber \ maxperpage                                                        
  else                                                        
     n= totalnumber \ maxperpage+1                                                        
  end if                                                                                                                                          
%>

我屡试不爽,找不出错误源头,无奈之于特来求助!在此先谢过大家!
请说明出了什么问题?
淡泊以明志 宁静而致远
在加上以下代码时,出现下面错误:“类型不匹配 showpage totalput,MaxPerPage”

if currentPage=1 then                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
            showContent                                                         
            showpage totalput,MaxPerPage,"index.asp"                                                         
       else                                                         
          if (currentPage-1)*MaxPerPage<totalPut then                                                         
            rs.move  (currentPage-1)*MaxPerPage                                                         
            dim bookmark                                                         
            bookmark=rs.bookmark                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
            showContent                                                         
             showpage totalput,MaxPerPage,"index.asp"                                                         
        else                                                         
               currentPage=1                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
           showContent                                                         
           showpage totalput,MaxPerPage,"index.asp"                                                         
             end if                                                         
          end if                                                         
============================================
而再加上以下代码时,又出现错误为:“无法打开页面”

sub showContent                       
       dim i                                                         
       i=0                                                         
end sub                                                        
function showpage(totalnumber,maxperpage,filename)                                                      
end function                                                      
  dim n                                                        
  if totalnumber mod maxperpage=0 then                                                        
     n= totalnumber \ maxperpage                                                        
  else                                                        
     n= totalnumber \ maxperpage+1                                                        
  end if              

谢谢你的关注,望解!

TOP

啊,这个问题是太难了,还是不屑于一解;拜托各位高手来看时留个话!

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
屡试不爽:屡次试验都没有差错。爽:差错的意思。

类型不匹配的意思是,变量间的数据类型不同。
你的totalput和MaxPerPage数值在哪里?
乐于助人、严格管理、言多必失。无知者无罪。Keep your waiting,I am back.
编程资源:http://book.kuhanzhu.com
对管理有异议,请前往事务区进行投诉。请勿PM。

TOP