ODBiC Discussion Board


RE: num of rows per page, sam, 01-03-2007

I'll send you an example file

by Roger Harris, January 6, 2007 08:34

There should be an example file in your download (the World Wide Widgets demo) that shows one way to do that. I'll send you a copy of that demo. Basically, if you can always have the rows ordered by a unique key, the techique is to use "SELECT TOP # ..." to limit the number of rows returned in a query, but also add a WHERE condition that returns only rows where the unique key is greater than the last row on the previous page. (So, you just need to pass that key in the "next" link on a page, and the next select will only get rows greater than that row.)

Not all database support the TOP keyword as shown in the example, however, but there is now a <% SETOPTION SQL_MAX_ROWS = # %> command that you can use immediately before the SELECT, which should work with any database.


Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.