Recordset paging with MySQL & ASP using LIMIT

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I have an asp page which I want to display 10 records with a
'Previous' and 'Next' link underneath for navigating through the rest
of the recordset.

I have the page displaying the first 10 records and the links. The
links work, but the data does not change.
How can I adjust the SQL so that the code re-runs the SQL ? Is there a
way to override the LIMIT or change the way it is written ??

n = request.querystring("n")
if n="" or n<0 or not IsNumeric(n) then n=0

strquery = "SELECT * FROM reports Where ReportID >" & n & " LIMIT 10;"
Set RS = adoDataConn.Execute(strquery)

     Do this
     Display records
End if


<a href='preview_all_test.asp?n=<% = n-10 %>'><font
color=yellow>Previous 10</a>
<a href='preview_all_test.asp?n=<% = n+10 %>'><font color=yellow>Next


Appreciate your help

Thanks in advance


Site Timeline