g
Printer Friendly Version

editor  
BellaOnline's ASP Editor
 

MoveNext Record Set Function

When you're working with a set of records in ASP, you want some way to move from record to record. The MoveNext function lets you do that.

Let's say you select all writers from your database with a statement like

SQLText = "select FirstName, LastName from writers order by LastName, FirstName"

You go through all the defining and opening of your record set and now want to move by them one by one, to put each one on your screen. You would say:

do while not objRec3.EOF
response.write objRec3("firstname") & " " & objRec3("lastname") & "
"
objRec3.MoveNext()
loop

If you did NOT do the MoveNext, the record wouldn't move on to the next record. You would keep printing out the same record, over and over again, until your server went insane and locked up :)

Really, infinite loops are REALLY bad for your system. Make sure you always have your records advancing properly before you test out your code!

This site needs an editor - click to learn more!

ASP Site @ BellaOnline
View This Article in Regular Layout

Content copyright © 2013 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact Editor Wanted for details.



| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2013 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor