View Single Post
Old 10-12-2011, 05:08 PM   #2
YuleBLucky
 
Join Date: Oct 2011
Location: London
Posts: 4
Default

I don't think you can get a page by ID or last record but you can certainly get a page that is sorted by ID and is also the last record:

I use the following code on a bar website in conjunction with a repeat region to show the full list of coctails, normally I'd 'ORDER BY Price DESC' but for your purposes 'ORDER BY ID ASC' should do the trick ( try DESC if ASC doesn't do it for you )

<%
Dim cocktailsRS
Dim cocktailsRS_numRows

Set cocktailsRS = Server.CreateObject("ADODB.Recordset")
cocktailsRS.ActiveConnection = MM_databaseConn_STRING
cocktailsRS.Source = "SELECT * FROM TableMenu ORDER BY ID ASC"
cocktailsRS.CursorType = 0
cocktailsRS.CursorLocation = 2
cocktailsRS.LockType = 1
cocktailsRS.Open()

cocktailsRS_numRows = 0
%>
YuleBLucky is offline   Reply With Quote