关于分页办法

2016-01-29 18:24 0 1 收藏

关于分页办法,关于分页办法

【 tulaoshi.com - ASP 】

  时间关系,没有经过完全测试,这个是大概意思。
CREATE PROCEDURE getnotes

   @forumID varchar(10),
   @a_intPageNo int ,
   @a_intPageSize int,
   @rootID varchar(10)
AS  
     declare @m_intRecordNumber int
     declare @m_intStartRecord  int
     declare @pagecount int
     declare @temp int
     declare @end  int
     declare @sql varchar(500)
     declare @bbsname varchar(25)
     declare @articles int
     declare @manager varchar(30)
     declare @selectrootID varchar(500)
     declare @temprootID varchar(10)

     select @m_intRecordNumber = @a_intPageSize * @a_intPageNo
     select @m_intStartRecord = @a_intPageSize * (@a_intPageNo - 1) + 1

     set nocount on       
     select @bbsname=subjectname,@manager=manager,@articles=articles from bbs_subjects where subjectID=@forumID
     if @rootID='0'
         begin
         -- select @sql='declare m_curTemp Scroll cursor for select ID,title,shrink,rootID,orderID,pubtime,hits,bytes,username,email from bbs_forum_'+@forumID+'  WHERE rootID in (select distinct rootID from bbs_forum_'+@forumID+' ) order by rootID desc,orderID asc'     
            select @sql='declare m_curTemp Scroll cursor for select rootID from bbs_forum_'+@forumID+' where rootID=parentID order by rootID desc'     
        end
     else
          select @sql='declare m_curTemp Scroll cursor for select ID,title,shrink,rootID,orderID,pubtime,hits,bytes,username,email from bbs_forum_'+@forumID+' where rootID='+@rootID+' order by orderID asc'     
     
     exec(@sql)
     open m_curTemp

       set @pagecount = case
            when  @@cursor_rows % @a_intPageSize=0 then @@cursor_rows / @a_intPageSize
            when  @@cursor_rows % @a_intPageSize<0 then @@cursor_rows / @a_intPageSize+1
       end
       if  @@cursor_rows<@a_intPageSize and @@cursor_rows0
          begin
             select @pagecount=1
          end
      

   if @rootID='0'
     begin
         set @temp = 1
         set @selectrootID='0'
        fetch absolute @m_intStartRecord from m_curTemp into @temprootID
        while  @@fetch_status = 0 and @temp < @a_intPageSize
             begin
                   s

来源:https://www.tulaoshi.com/n/20160129/1505621.html

延伸阅读
标签: Web开发
?php /* 需求,建立一个test数据库,在里边建一个test表,里面就 只要id字段,输入一下数据就可以啦。。 由于水平有限,难免出错。。 */ $conn = mysql_connect("localhost","root",""); $maxnum = 2;  //每页显示记录条数 mysql_select_db("test", $conn); $query1 = "SELECT CO...
标签: ASP
最近做网站遇到了一个奇怪的问题,在进行DataGrid进行分页时,无法响应 PageIndexChanged 事件 。 我也查阅了很多关于这方面的文章,可是还是没有得到解决方案。 在和别人的探讨中发现了症结所在 首先,我先将代码贴过来: 下面是DataGird控件的HTML代码(不包含字段绑定) <asp:datagrid id="SearchGrid" runat="server" width="10...
标签: Web开发
代码如下: !-- //ASP分页函数 function ShowListPage(page,Pcount,TopicNum,maxperpage,strLink,ListName){     var alertcolor = '#FF0000';     maxperpage=Math.floor(maxperpage);     TopicNum=Math.floor(TopicNum);     p...
《上古卷轴5:天际》关于吸血鬼解决办法 首先确保你在进化到第四形态前有过一次存档!!!!这是前提,否则大罗金仙也帮不了你,从头来过吧。 如果有存档,哪怕离最终形态只有几分钟也有的救。本人就还剩10分钟(游戏里的时间,默认速度)。 首先赶紧调出指令台(坚决不用指令台的人请重建人物吧。。。),输入set timescale to 0,也就是时间...
标签: 电脑入门
Word插入脚注后分节符自动变成分页符解决办法 问题描述: 首页上一部分是单栏,一部分是双栏的话,如果在单栏部分加上一个页面底部的脚注,那么双栏部分立即会跑到下一页去,造成第一页一大片空白。如何 把后面分栏的部分合并到第一页??? 解决方案: 要解决此问题在 Microsoft Office Word 2003 或 Microsoft Word 2002 中,请执行下列步骤...

经验教程

68

收藏

82
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部