#1
  1. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jan 2004
    Location
    Budapest
    Posts
    1,703
    Rep Power
    67

    Baffled by Do While Loop


    I consider myself pretty advanced when it comes to ASP and am very familiar with simple coding such as if then else and do until statements, but this one has me stumped. After opening a database I am attempting to run a bit of code such as

    do until rs.eof
    .
    .
    .
    rs.movenext
    Loop

    Problem is that that crashes my page. When I remove the do until and insert my block of code followed by a rs.movenext and another block of code it works, meaning I am not at the eof I am a bit clueless as to how to proceed...

    Thanks
    Today the world, tomorrow the universe...
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,443
    Rep Power
    4539
    There's nothing wrong with the loop structure so you must have some problem with the 'do-ing' stuff. maybe if you described what you mean by 'page crashes'?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Location
    Charlotte
    Posts
    412
    Rep Power
    144
    I haven't done *tons* of Classic ASP programming, but I've never seen a recordset processed with a Do Until. For whatever reason, I've *always* seen it done with a Do While. Like this:
    Code:
    If not rs.EOF Then
         Do while not rs.EOF
                      // code goes here
             rs.Movenext
        Loop
    End If
    Give that a try and see what happens ?

    Certainly can't hurt.

IMN logo majestic logo threadwatch logo seochat tools logo