Click to See Complete Forum and Search --> : Stepping through a database
jPaulB
09-29-2005, 02:18 PM
Hi Everybody,
I've managed to connect to a database, and even display the whole recordset as a long list using a Loop.
However, what I wish to do is step though this recordset, one at a time using a "NEXT" and "PREVIOUS" button.
How do I start adapting the loop script to accomplish that?
Thanks
-Paul-
Bullschmidt
09-29-2005, 04:01 PM
Usually set for more than one record per page but perhaps these could help:
Database Paging
http://www.asp101.com/samples/db_paging.asp
Uses PageSize method of recordset.
Paging Records with GetRows by Mukul Sabharwal - 7/5/2000
http://www.4guysfromrolla.com/webtech/070500-1.shtml
Uses GetRows.
Displaying a certain # of records on each webpage Paging
http://www.aspfree.com/asp/startpage.asp?id=11
Uses PageSize method of recordset.
Shorter.
Recordset Paging with ADO 2.0 by Michael Qualls
http://www.asp101.com/articles/recordsetpaging/index.asp
Uses PageSize method of recordset.
Longer with more comments.
jPaulB
10-02-2005, 01:02 PM
Yikes! Even these examples were way over my head.
It seems to me that this statement fills an array with a recordset of everybody in the table whose family name (fam) is Smith:
Set rsNames =Connect.Execute("SELECT * FROM history WHERE fam = 'smith' ")
I ought to be able to simply focus on that array (rsNames) and apply some kind of "Next" and "First" structute to display the records one at a time.
I could not 'see' where they were doing just that in any of the tuts.
Again, any help is appreciated
-Paul-
russell_g_1
10-02-2005, 03:18 PM
rsNames.movefirst moves you to the start of the recordset
rsNames.movenext moves you one record forwards
rsNames.moveprevious moves you one record backwards
rsNames.movelast moves you to the end of the recordset
rsNames.move(x) will move you any number of records in the recordset