ASP: Creative paging?

  • Without using .NET (because it's just not an option at the moment) is there a way to page a query based on a data grouping or filter? We are trying to avoid running a query each time the filter changes, because the execution is a little longer than a normal user's patience threshhold. Any ideas?

  • Have you looked into disconnected record sets?  If you don't want to requery the data each time a new page is selected then you can query once and set the connection object of the recordset to null.  Once you have set the page size of the recordset, then you can get each page from the recordset by setting the page number property.

    Another option, using multiple queries would be to have the calling application pass the page size and page requested back to your query.  Using a set rowcount x statemnt prior to your execution, you could get the top page * page size records and then just pass back the proper page to your calling application.

    Steve

  • I've done something similar in the past by using multiple record sets in the asp page and using DIV tags to hide the ones not selected.  In my case I was using a combo box for year and depending upon which year the user selected i would dynamicly reveal a second cobmo box that contained the months for that year where data existed.  This allowed me to show just july thru dec for 2004, jan thur dec for 2006 and jan thru apr for 2007. 

    This may work for you, depending upon the size of you record sets.

    Regards,
    Matt

  • Thank you for the replies. Our ASP developer has read warnings not to store a recordset in a session. We were avoiding fixed result sizes anyhow.

    Fortunately we found that rerunning the query with the additional filter was considerably faster, so we wont need to worry about this anymore.

    I can't wait until we can start using .NET on this project.

    CHEERS!

    -KM

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply