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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't find what's killing this page.....endless loop?...

Status
Not open for further replies.

wvmikep

Programmer
Feb 26, 2001
35
US
If I do the same thing in ColdFusion, the page loads quickly. However, this ASP code seems to have some issues as the page never fully loads. I'm following the logic used in my CF code. Any ideas what's killing it?
All the way up to the "pretty much just some HTML here" area has been tested and showed no performance issues.
Thanks

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = strwmsdb
objConn.Open

Dim strSQL
strSQL = "select * from boardlists order by boardgroup, id"

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn
.
.
(pretty much just some HTML here)
.
.
Dim gr_check, gr_no
gr_check = 0
gr_no = 0

Do While Not objRS.EOF
If objRS(&quot;boardname&quot;) <> &quot;&quot; then
If gr_check = 0 then
gr_no = objRS(&quot;boardgroup&quot;)
Response.Write &quot;<tr>&quot;
%>
<td valign=&quot;top&quot; colspan=&quot;4&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;100%&quot;><font class=&quot;messtitle&quot;><%= objRS(&quot;gr_name&quot;) %></font></td>
<%
Response.Write &quot;</tr>&quot;
gr_no = 1
End If
Dim strSQLGetMods, strSQLTot_Messes, strSQLGetRec
strSQLGetMods = &quot;SELECT * FROM board_mods WHERE boardnum = &quot; & objRS(&quot;id&quot;) & &quot; ORDER BY userid&quot;
strSQLTot_Messes = &quot;SELECT count(*) as tots FROM messages WHERE boardnum = &quot; & objRS(&quot;id&quot;)
strSQLGetRec = &quot;SELECT * FROM index_rec_mess WHERE boardnum = &quot; & objRS(&quot;id&quot;) & &quot; ORDER BY messdate DESC&quot;

Dim objRSGM, objRSTM, objRSGR
Set objRSGM = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set objRSTM = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set objRSGR = Server.CreateObject(&quot;ADODB.Recordset&quot;)
objRSGM.Open strSQLGetMods, objConn
objRSTM.Open strSQLTot_Messes, objConn
objRSGR.Open strSQLGetRec, objConn
If gr_no <> objRS(&quot;boardgroup&quot;) then
gr_no = objRS(&quot;boardgroup&quot;)
Response.Write &quot;<tr>&quot;
%>
<td valign=&quot;top&quot; colspan=&quot;4&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;100%&quot;><font class=&quot;messtitle&quot;><%= objRS(&quot;gr_name&quot;) %></font></td>
</tr>
<tr>
<td valign=&quot;top&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;45%&quot;><font class=&quot;basictext&quot;><cfoutput>&raquo; <a href=&quot;messages.cfm?board=<%= objRS(&quot;id&quot;) %>&quot;><%= objRS(&quot;boardname&quot;) %></a></cfoutput><cfif private EQ 1><br><b>PRIVATE</b>&nbsp;&nbsp;&nbsp;&nbsp;(<a href=&quot;private_login.cfm?board=<%= objRS(&quot;id&quot;) %>&quot;>Log In</a>)</cfif></font></td>
<td valign=&quot;top&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;25%&quot; align=&quot;center&quot;><font class=&quot;basictext&quot;>
<%
Dim strTheMods, iTheLenMods
strTheMods = &quot;&quot;
Do While Not objRSTM.EOF
strTheMods = strTheMods & &quot;, &quot; & objRSTM(&quot;userid&quot;)
Loop
iTheLenMods = len(strTheMods) - 2
strTheMods = right(strTheMods, iTheLenMods)
Response.Write strTheMods & &quot;</font></td>&quot;
%>
<td valign=&quot;top&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;10%&quot; align=&quot;center&quot;><font class=&quot;basictext&quot;><%= objRSTM(&quot;tots&quot;) %></font></td>
<td valign=&quot;top&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;20%&quot; align=&quot;center&quot;><font class=&quot;basictext&quot;><%= objRSGR(&quot;authorname&quot;) %><br><%= objRSGR(&quot;messdate&quot;) %></font></td>
</tr>
<tr>
<td valign=&quot;top&quot; colspan=&quot;4&quot; bgcolor=&quot;<%= strbgcolor %>&quot; width=&quot;100%&quot;><font class=&quot;basictext&quot;><%= objRS(&quot;boarddesc&quot;) %></font></td>
</tr>
<%
End If
objRSGM.Close
Set objRSGM = Nothing
objRSTM.Close
Set objRSTM = Nothing
objRSGR.Close
Set objRSGR = Nothing
End If
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
------------------------------------
&quot;Unclean beast! Get thee down! Be thou consumed by the fires that made thee!&quot; - Brother Jacobus in Dragonslayer
 
Dummy me, I forgot:

objRS.MoveNext

and

objRSTM.MoveNext

It wasn't incrementing through the list. :) ------------------------------------
&quot;Unclean beast! Get thee down! Be thou consumed by the fires that made thee!&quot; - Brother Jacobus in Dragonslayer
 
Also you should consider removing all DIMs inside loops.

/J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top