The solution you implement will depend on your current situation. One decision you must make is whether to use a SELECT statement, or the traditional SET ORDER TO/SEEK combination. Typically, if you are searching on an indexed value, the SEEK command will give you better performance, but obviously SELECT statements are more flexible in terms of the kinds of searches you can perform. Also, if you are querying against an ODBC data source then the SELECT statement method will work better (but you should also look into the caching technique described later).
Nomatter which technique you end up choosing, you will need to save the current page number and search criteria as hidden fields or query string variables. When a user clicks on the Next/Previous button, this information will be passed back to the server. Your script should first access the first record of the search (either by re-issuing the SELECT statement, or the SEEK command) and then SKIP to the correct record:
Obviously the above example is missing a lot of code, such as a check for the end of the result set, but you get the idea.
If you go with a SELECT search, then another decision you must make is whether you want to redo your search with every request, or cache the result set, by saving it as a temporary table on the server and passing the file name as a hidden field. The answer to this will depend on how long it takes to perform the search, how often this type of search occurs, the size of the result set, etc..
The ContactMine2 sample application illustrate some of the paging techniques described above.
FoxWeb Support Team
Sent by javier conde on 04/09/2002 11:06:20 AM: