Do While Loop

Results 1 to 5 of 5

Thread: Do While Loop

  1. #1
    Whisao Guest

    Default Do While Loop

    Hi, I have the following loop, but if there is only one record, the movenext gave me a EOF error... Can anyone help me solve the problem? Thank you<BR><BR>&#060;% Do While NOT objRS2.EOF<BR> Response.Write (objRS2("Con_fname")&" "&objRS2("Con_mname"& " "&objRS2("Con_lname")<BR> Response.Write ("/BR/")<BR> objRS.Movenext<BR> Loop<BR>%&#062;<BR><BR>p.s just replace /BR/ with the &#060;&#062;

  2. #2
    Just a guess Guest

    Default Try...

    Do Until RS.EOF instead of WHILE NOT

  3. #3
    Join Date
    Dec 1969

    Default RE: Do While Loop

    Tsk, tsk. Didn&#039;t use option explicit, eh?<BR><BR>You have two things objRS2 and objRS.Movenext...<BR><BR>Which is which??

  4. #4
    Whsiao Guest

    Default RE: Stupid me

    .... stupid me... I did use option explicit, except I did have both objRS and objRS2 for 2 diff record sets... thanks

  5. #5
    Join Date
    Dec 1969

    Default You missed the discussion...

    ...of a couple of days ago. Not only do those two act the same, they actually produce *IDENTICAL* "byte code" for the VBScript interpreter to execute. They are just different human-readable versions of exactly the same thing, so far as the VBS compiler is concerned. As is WHILE...WEND (though it doesn&#039;t allow Exit Do for the obvious reason there is no DO to exit).<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts