Once I've run a "Do While Not RS.EOF ... Loop", how do I reset the cursor to BOF so I can run another loop later in my script?
Cursor location in RecordsetASP recordset
Page 1 of 1
9 Replies - 7303 Views - Last Post: 13 September 2002 - 01:12 AM
Replies To: Cursor location in Recordset
#2
Re: Cursor location in Recordset
Posted 15 March 2002 - 02:05 PM
You can't.
At least, I've never found a way. You can either rerun the query, or store the Recordset in an array to use multiple times. :)
#3
Re: Cursor location in Recordset
Posted 24 July 2002 - 06:47 PM
Probably a little late with the answer, but if you just want to get back to the start, you should just be able to use one of the Move commands. RS.MoveFirst would be the best one, or if supported, just an RS.Move(place number here). HTH!
#4
Re: Cursor location in Recordset
Posted 29 July 2002 - 07:51 AM
Yea, I'd say you want to use a MoveFirst for this case. That's what I use anyways...
#5
Re: Cursor location in Recordset
Posted 30 July 2002 - 08:09 AM
You use MoveFirst after looping through to EOF?
Cuz I'm pretty sure that doesn't work ;)
Cuz I'm pretty sure that doesn't work ;)
#6
Re: Cursor location in Recordset
Posted 30 July 2002 - 12:08 PM
Sure it does, unless I'm missing something in this topic...
See, using .MoveFirst to get to the First record to begin a new loop....
Do Until Rs2.EOF Lots' of code.... Rs2.MoveNext Loop Rs2.MoveFirst Do Until Rs2.EOF Lots' of other code.... Rs2.MoveNext Loop
See, using .MoveFirst to get to the First record to begin a new loop....
#7
Re: Cursor location in Recordset
Posted 30 July 2002 - 01:37 PM
hm... that's weird. i've never been able to get it to work. i've always had to re-run the query...
#8
Re: Cursor location in Recordset
Posted 30 July 2002 - 06:17 PM
Hmm....should work, unless the recordset has been closed, or something like that.
#9
Re: Cursor location in Recordset
Posted 31 July 2002 - 06:15 AM
What cursor type, lock, etc are you using?
#10
Re: Cursor location in Recordset
Posted 13 September 2002 - 01:12 AM
You need to use an adOpenKeyset results set. The default is adForwardOnly.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|