Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql database navigation

Status
Not open for further replies.

tburrows

Technical User
Oct 3, 2003
49
US
I have a SQL database that has information on persons and path to photo. On the webpage I have a table and it displays the first record in the recordset. I can also put in a loop to make a table for each record in the database. What I want to do is make make navigation buttons so that I can click the button and have the next record displayed. Want to use the usual navigational aids, movenext moveprevious movefirst etc. What I have now is on an asp page. Any info would be greatly appreciated.

Tom
 
You will need to have something to keep track of the records you are on. Then provide a link in a querstring. For example:

<%
dim i
'Assuming your database is already connected

i = Request.Querystring("Position")
rs.move(i)

if rs.eof = true then
rs.movefirst
i = 1
end if

'Show record information here.

Response.write "<a href='page.asp?Position=" & i - 1 & "'>Move Previous</a>"
Response.write "<a href='page.asp?Position=" & i + 1 & "'>Move Next</a>"

%>

I didn't error check it but it displays the drift.

Let me know if you need something different.

Cassidy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top