Link to home
Start Free TrialLog in
Avatar of webdork
webdork

asked on

ASP Run Loop Twice

I want to run a loop twice. I know it would be more elegant to do all action in one loop but I'm struggling with the syntax and I need the same record set further down the code.  Is the first loop stopping the second?
While  (NOT rsAgents.EOF) 
'Do Action	
rsAgents.MoveNext()
Wend
 
While  (NOT rsAgents.EOF) 
'Do another Action	
rsAgents.MoveNext()
Wend

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Pearl_export_ben
Pearl_export_ben
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And just to add a little more - Yes the first loop was stopping the second.  The first loop would loop through all your results to EOF (End Of File or ResultSet) and then the second loop would pick up where the first left off - at the end of your data - and thus wouldn't be able to manipulate the already played with data.

Ben
Triple post - I know its naughty - sorry :(

'This will take you back up to the top line of your code
SHOULD BE
'This will take you to the first result in your file/resultset - not the first line of your code.

Ben
Avatar of webdork
webdork

ASKER

Too easy!
rsAgents.MoveFirst() did the trick.
Thanks.
Avatar of webdork

ASKER

Oh Goody