Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INFINITE LOOP

Status
Not open for further replies.

CooterBrown

IS-IT--Management
Aug 17, 2001
125
US
Can someone tell me why this is an infinite loop.
It is like the rslist.MoveNext isn't working!! Please help!! It is outputting the response.write infinately. Why no eof?

<%

set OBJdbConnection=server.createObject(&quot;adodb.connection&quot;)
strProvider=&quot;driver=Microsoft Access Driver (*.mdb); DBQ=&quot; &_
server.mappath(&quot;../database/DailyQuotes.mdb&quot;) & &quot;;&quot;

OBJdbConnection.open StrProvider

set rsList = server.createObject(&quot;adodb.recordset&quot;)

rslist.activeconnection = OBJdbConnection
rslist.source= &quot;SalutesToAmerica&quot;
rslist.open

todayDate=date

do until rslist.eof
americaquote=rslist(&quot;SaluteToAmericaQuote&quot;)
americasource=rslist(&quot;SaluteSource&quot;)
cheesequote=rslist(&quot;CheeseQuote&quot;)
cheesesource=rslist(&quot;CheeseSource&quot;)
johnsonquote=rslist(&quot;SJQuote&quot;)

if rslist(&quot;date&quot;)= date then

session(&quot;AmericaQuote&quot;) = americaquote
session(&quot;AmericaSource&quot;)=americasource
session(&quot;CheeseQuote&quot;)=cheesequote
session(&quot;CheeseSource&quot;)=cheesesource
session(&quot;JohnsonQuote&quot;)=johnsonquote

response.write Session(&quot;CheeseQuote&quot;)

else

rsList.MoveNext

End IF
loop

%>
 
HI m8 a bit of your code is the wrong way around

response.write Session(&quot;CheeseQuote&quot;)

else

rsList.MoveNext <<<<this shoule be after

End IF <<<<this
loop
%>


What is ahppening is that its going to the 1st record checking to see if ur date field = date doing a bit then looping because the bit of code to move to the next record is in the &quot;else&quot; part of your if statement

Hope this helps

Joe
 
Duh...OKAY..I'm an ediot. Or I could have put rslist.movenext after the response.write...
Thanks!
 
or just skip the Else, since there's no special processing for the Else condition:

response.write Session(&quot;CheeseQuote&quot;)

End If

rsList.MoveNext
loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top