Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Record numbering problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Record numbering problem

 Post Reply Post Reply
Author
lenacheong View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2003
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote lenacheong Quote  Post ReplyReply Direct Link To This Post Topic: Record numbering problem
    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
%>
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.