Ciberperson's right.
However, here are some further notes and suggestions:
Ciberperson's suggestion will work as long as you don't want to move backwards
and forwards. If you want to do both
on the same recordset then you have to use the recordset.movenext and the recordset.moveprevious methods. But if you try to do this and you don't have your recordset set up correctly you'll get an error like this:
[red]The operation requested by the application is not allowed in this context.[/red]
There are two ways to achieve a two-way freedom of motion in the recordset. The first is to set the recordset cursor to dynamic mode. A lot of the time all you need to do to open a recordset is write:
recordsetName.open
someSQLstring, connectionName
HOWEVER, although there are only two parameters passed to the open method as shown above, there are three more parameters you can pass to this method. The full FIVE parameters for the recordset.open method are:
recordset.open
source, databaseConnection, cursorType, LockType, whatthesourceis
The important one here is the third parameter "cursorType" which, if you don't include it, defaults to 0 or "adOpenForwardOnly". If you set this value to 2, however, you will have the recordset in "adOpenDynamic" mode which means you can move backwards and forwards. Here's an example which moves first all the way forward then all the way back through a single recordset:
-----------------------------------------------------------
[red]
set db = server.createObject("ADODB.Connection"

db.Open "yourdatabase"
set testrec = server.createObject("ADODB.recordset"

Const adOpenDynamic = 2
testrec.Open "SELECT name FROM table ORDER BY name", db, adOpenDynamic[/red]
'-------------FORWARDS
[red]do while NOT testrec.EOF
[tab]response.write(testrec("name"

&"<br>"

[tab]testrec.movenext
loop[/red]
'-------------BACKWARDS
[red]testrec.moveprevious
do while NOT testrec.BOF
[tab]response.write(testrec("name"

&"<br>"

[tab]testrec.moveprevious
loop
[/red]
2. The other way to achieve two-way motion would be to use "recordset.getrows" which transfers your recordset into an regular VBScript (or JScript) array. Then you can do whatever you want with it that you can do with an array. This option is more scaleable also. There's an explanation of how to do this at:
Good Luck! [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]