Record paging through question

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Record paging through question

    I have a problem with the paging function. The rs.pagecount seems only
    refer
    to the total number of records, not the selected ones. So it works
    well on
    the first page, while it goes back to the original number of records
    starting
    from the second page. For example, I have a table with a total of 1000
    records,
    that is the number of myrs.recordcount and the number of pagecount
    (with fixed pagesize), when I select 400 from the 1000 records with
    the SQL select
    statement, the pagecount and recordcount work well on the first page
    display but it goes back to the original 1000 records from the second
    page. Is there something that can be used to remember my selected
    records so it doesn't
    go back to the original ones? Thanks so much for your help.
    risa Guest

  2. Similar Questions and Discussions

    1. Efficient record paging in CFMX MSSQL
      When we moved from CF5 to CFMX, we saw the read speeds on our MS SQL2000 database increase by 1500%. A simple read coded as shown below, ran in...
    2. Paging question
      Hi all and thanks in advance for your help, I am reading this book called ASP.NET unleashed and on the datagrid section it says that there is a...
    3. Single Record Paging in a Query
      Once on a single record's detail page, I use it's CategoryID to create a second query, which is a list of records in the same category. I would like...
    4. Single row of data displayed horizontally next to label names with paging per record... possible?
      My employer really likes DataGrids for displaying some of our data for dashboards and such, but would like to be able to browse one of our...
    5. Custom Paging Question
      Greetings, I have a problem that I am trying to work through. Any help would be appreciated. I have an asp.net application that uses...
  3. #2

    Default Re: Record paging through question

    > Another thing I see reading through this, is you should select ALL the
    > records and not top 400 or something like that.
    So if there are 18,000,000 rows, risa should select ALL the rows?


    Aaron Bertrand - MVP Guest

  4. #3

    Default Re: Record paging through question

    What I meant was, the query shouldn't reflect the number of records. Maybe I
    am wrong, but this is how I do it:

    <%

    sql = "select * from TABLE"

    set r = Server.CreateObject("ADODB.RecordSet")
    r.pagesize = 6
    r.open sql, conn, 3

    if r.eof then
    response.write "NO RECORDS"
    else

    r.absolutePage = currpage
    recs = r.recordCount

    for x = 1 to r.Pagesize

    'DISPLAY STUFF
    if r.eof then exit for

    r.moveNext
    next

    end if

    %>

    Regards,

    McG

    "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
    news:%23zDlpWJbDHA.1748@TK2MSFTNGP12.phx.gbl...
    > > Another thing I see reading through this, is you should select ALL the
    > > records and not top 400 or something like that.
    >
    > So if there are 18,000,000 rows, risa should select ALL the rows?
    >
    >

    Michael C. Gates Guest

  5. #4

    Default Re: Record paging through question

    Thanks for the reply. That is my question as well. What I want is to
    be able to page the selected ones, not ALL. I did use the
    querystring("page") but it seems to work only on the first query
    result page. My code has 180 lines, is it too long to post it here?
    Please help!
    risa Guest

  6. #5

    Default Re: Record paging through question

    180 lines?

    You might try to work through a couple of these examples, instead of
    re-inventing the wheel.

    [url]http://www.aspfaq.com/2120[/url]

    The biggest one is 91 lines, including delimiters and plenty of comments.
    You could make it even more efficient by using getRows() instead of looping
    through a recordset. Also, you didn't mention which database you are using,
    but if it's SQL Server, you can perform a lot of the filtering at the
    database end, reducing network chatter...




    "risa" <risa_wu@ci.cerritos.ca.us> wrote in message
    news:9019be51.0308270928.773883e7@posting.google.c om...
    > Thanks for the reply. That is my question as well. What I want is to
    > be able to page the selected ones, not ALL. I did use the
    > querystring("page") but it seems to work only on the first query
    > result page. My code has 180 lines, is it too long to post it here?
    > Please help!

    Aaron Bertrand - MVP Guest

  7. #6

    Default Re: Record paging through question

    Thank you very much for your help, Michael and Aaron: I am going to
    give it a try again today. Michael, what is your email address? I
    cannot seem to get it.
    Risa
    risa Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139