I have a script where I use recordset paging and it works fine. There are previous and next links to navigate. I currently only have one record showing at a time. It is a photo gallery. I want to be able to get the id of the next and previous unique id while i am viewing the current photo so I can calculate hits. Can anyone help? Here is some code
Quincy
Code:
sql2 = "Select tbl_Images.* From tbl_Images Where imageEventID="&tid&";"
Set rsGallery = Server.CreateObject("ADODB.Recordset")
rsGallery.PageSize = 1
rsGallery.CacheSize = 5
rsGallery.CursorLocation = adUseClient
rsGallery.Open sql2, adoCon, adOpenForwardOnly, adLockReadOnly
If abspage = 1 Then
Response.Write "|< First"
Response.Write " | "
Else
Response.Write "<a href="""
Response.Write Request.ServerVariables("SCRIPT_NAME")
Response.Write "?tid="&tid&"&pagenum=1"">|< First</a>"
Response.Write " | "
End IF
If abspage = 1 Then
Response.Write "<< Previous"
Else
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME")
Response.Write "?tid="&tid&"&pagenum=" & abspage - 1 & """><< Previous</a>"
End If
Response.Write " | "
If abspage < pagecnt Then
Response.Write "<a href=""" & _
Request.ServerVariables("SCRIPT_NAME")
Response.Write "?tid="&tid&"&pagenum=" & abspage + 1 & """>>> Next</a>"
Else
Response.Write ">> Next"
End If
Response.Write " | "
If abspage < pagecnt Then
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME")
Response.Write "?tid="&tid&"&pagenum=" & pagecnt & """>>| Last</a>"
Else
Response.Write ">| Last"
End If
Response.Write "</div>" & vbcrlf
Else
Response.Write "No records found!"
End If
Quincy