Print Page | Close Window

Record numbering problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6942
Printed Date: 29 March 2026 at 5:30pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Record numbering problem
Posted By: lenacheong
Subject: Record numbering problem
Date Posted: 03 November 2003 at 4:30am
But I have a problem. I set 30 records per page, my
record skips on the 49th (2nd page). The record
shown on 49th is actually 75th record in the
database. Can anyone tell me what's wrong with my
script?

Part 1 of my script:
<%thispage =
Request.querystring("thispage")
       if  thispage = "" then
            this page = 1
       end if
            SQL= "S elect * from mail_list"
            set objRS=dbs.execute(SQL)
            got _result=false
       if not objRS.eof then
              got_result=true
              set objRS=
Server.createObject("ADODB.Recordset")
              with objRS
               .cursortype=3
                .Pagesize=30
                .Open SQL,dbs
                .Absolutepage = Cint(thispage)
                end with
                maxpages=int(objRS.Pagecount)
                maxrecs=Cint(objRS.Pagesize)+1
                rowcount=1
                                   
                curpage=thispage
              if (thispage mod 10) = 0 then
                   thispage=thispage-10
              else
                   thispage=thispage-(thispage mod 10)+1
              end if
                   endpage=thispage+10
               if endpage > maxpages then
                   end page = maxpages
              end if

              if maxpages <> 1 then%>


Part 2 of my script:
<%
'row count
if got_result=true then    
    while not objRS.eof and rowcount < maxrecs
       
        if curPage=1 then
           count=rowcount
        else         
          count= (curpage*30)+rowcount-30
       end if
%>



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net