Print Page | Close Window

Fatal Loop!!!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6288
Printed Date: 31 March 2026 at 3:20am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Fatal Loop!!!
Posted By: White Fyre
Subject: Fatal Loop!!!
Date Posted: 09 October 2003 at 12:56pm

Help!

I can't figure out why this code is looping and crashing me!!

I was told that it is looking to "MoveNExt" after it reached the EOF. But I don't see how.

It goes into a fatal loop when it hits the "if/then/else" statement WITHIN the "While NOT Recordset1.EOF" statement.

Oh...my top 4 llines of code in the file are:

<% @Language VBScript %>

<% Option Explicit

Response.Buffer = True

%>

        Please help!!???

<%
WHILE NOT Recordset1.EOF
 %>
  <tr>
  <td width="20%" height="17"></td><%
 
 if ChiSpu = 1 then %>
 
  <td align="center" width="26%" Hieght="17">sometext</td>
  <td align="center" width="26%" Hieght="17"></td>
  <td align="center" width="26%" Hieght="17">sometext</td><%
 
 Else %>
 
  <td align="right" width="26%" eight="17"><%=(recordset1.fields.item("Name").value)%& gt;</td>
      <td width="1%" height="17"></td><%Recordset1.movenext%>
      <td align="center" width="5%" height="17" nowrap>Some Text</td>
      <td width="1%" height="17"></td><%
 
  If Recordset1.EOF = True then
 
   ChiSpu = ChiSpu + 1
 
  Else
 
   ChiSpu = ChiSpu + 1 %>
      <td width="31%" h eight="17"><%=(recordset1.fields.item("Name").value)%& gt;</td>
   <td width="20%" height="17"></td><%

   If Recordset1.EOF = True then

   Else
    Recordset1.movenext
   End if
  End If
 End if 
 Response.Flush
Wend
%>

 

What is the problem???




Replies:
Posted By: Coco Brown
Date Posted: 09 October 2003 at 1:34pm

Try using...

Do While (Recordset1.EOF = false)



Posted By: Gullanian
Date Posted: 09 October 2003 at 3:26pm

your missing a loop

put:

Loop

Before wend



Posted By: White Fyre
Date Posted: 09 October 2003 at 9:45pm

Update...

The cause of the Fatal Loop is the first "If/then/else" statement.

Why would that cause a fatal loop????



Posted By: vshriniwasan
Date Posted: 10 October 2003 at 1:45pm
<table>
<% Do Until Recordset1.EOF %>
 <tr><td align="right" width="26%" eight="17"><%=(recordset1("Name")) %></td></tr>
<% Recordset1.movenext
loop %>
</table>



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net