Recordset paging with MySQL & ASP using LIMIT

Hi,

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)

If RS.EOF
Do this
Else
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
10</a>

____________________________________________________________ ______________________


Appreciate your help

Thanks in advance

David
davidgordon [ Mi, 25 April 2007 10:45 ] [ ID #1697082 ]
Datenbanken » mailing.database.mysql » Recordset paging with MySQL & ASP using LIMIT

Vorheriges Thema: DELETE with related table
Nächstes Thema: database recovery and import