Hvorfor er den langsommere?
HejsaJeg har en kode, som jeg har tilpasset mySQL, men den er blevet sindsyg langsom, hvorfor?
<!-- #INCLUDE FILE=\"config.inc\" -->
<!-- #INCLUDE virtual=\"top.asp\" -->
<!-- #INCLUDE virtual=\"/dbadgang.asp\" -->
<font face=\"Arial\"><br>
<%
\' Function treeMessage_Build() goes through the messages recursively,
\' and shows all messages in a tree-like structure.
\' This is the basis of the \"threaded\" discussion that is
\' unique to this script.
Public Sub treeMessage_Build(MessageID, Level)
Dim rsfor_bes
Set rsfor_bes = conn.execute (\"SELECT * FROM for_bes WHERE ForumID = \" & ForumID & \" ORDER BY Date DESC\")
rsfor_bes.Filter = \"MessageID = \" & MessageID
%> </font>
<TR>
<TD WIDTH=\"60%\" ALIGN=\"left\"><font face=\"Arial\"><IMG SRC=\"spacer.gif\" WIDTH=\"<%= Level * 20 %>\" HEIGHT=\"1\"><IMG SRC=\"message.gif\" WIDTH=\"24\" HEIGHT=\"19\" ALIGN=\"absmiddle\" HSPACE=\"4\"><A HREF=\"message.asp?MessageID=<%= rsfor_bes (\"MessageID\") %>\"><%= rsfor_bes (\"Subject\") %></a>
</font>
<TD WIDTH=\"20%\" ALIGN=\"left\"><font face=\"Arial\"><IMG SRC=\"face.gif\" WIDTH=\"18\" HEIGHT=\"25\" ALT=\"\" ALIGN=\"absmiddle\" HSPACE=\"4\">
<% if rsfor_bes(\"email\") = \"admin@food4u.dk\" then %> <a href=\"/sendmail.asp?mode=forum\"><img
src=\"/gfx/system/food4u - forum.gif\" border=\"0\"></a> <% else %> <a href=\"mailto:<%= rsfor_bes(\"email\") %>\"><%= rsfor_bes(\"PostedBy\") %></a>
<% end if %> </font>
<TD WIDTH=\"20%\" ALIGN=\"right\"><font face=\"Arial\"><%= ShortDate(rsfor_bes (\"Date\")) %>
</font>
</TR>
<font face=\"Arial\"><%
rsfor_bes.Filter = \"InReplyTo = \" & MessageID
If Not (rsfor_bes.EOF And rsfor_bes.BOF) Then
while Not rsfor_bes.EOF
treeMessage_Build rsfor_bes(\"MessageID\"), Level+1
rsfor_bes.MoveNext
Wend
End If
End Sub
%> <%
If Request (\"ForumID\") = \"\" Then
\' We don\'t have a valid ForumID, so go back to the main page.
Response.Redirect \"default.asp\"
End If
Dim ForumID
ForumID = Request(\"ForumID\")
Dim rsForum, rsfor_bes, rsThreads
Set rsForum = conn.execute (\"SELECT * FROM for_kat WHERE ForumID = \" & ForumID)
Set rsfor_bes = conn.execute (\"SELECT * FROM for_bes WHERE ForumID = \" & ForumID & \" ORDER BY Date DESC\")
Set rsThreads = conn.execute (\"SELECT * FROM for_bes WHERE ForumID = \" & ForumID & \" AND InReplyTo = 0 ORDER BY Date DESC\")
If rsThreads.BOF And rsThreads.EOF Then
ShowError (\"<P ALIGN=\"\"center\"\">Der er ingen beskeder i dette forum.</P>\")
%> </font>
<P ALIGN=\"center\"><font face=\"Arial\"><B><A HREF=\"post.asp?ForumID=<%= ForumID%>\">Opret
nyt indlæg</A></B></font></P>
<font face=\"Arial\"><%
Else
%> </font>
<TABLE WIDTH=\"90%\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"12\" ALIGN=\"CENTER\">
<TR ALIGN=\"LEFT\" VALIGN=\"TOP\" BGCOLOR=\"#990000\">
<TD colspan=\"2\">
<H1><font face=\"Arial\"><%= rsForum(\"Forum\")%></font></H1>
<P><font face=\"Arial\"><%= rsForum(\"Description\")%></font></P>
<P><A HREF=\"post.asp?ForumID=<%= ForumID %>\"><B><font face=\"Arial\">Opret
nyt indlæg</font></B></A></P>
<table width=\"100%\" align=\"center\" cellpadding=\"6\" cellspacing=\"0\" border=\"0\" bordercolor=\"#FFFFFF\" style=\"border: 1; border-color: #ffffff; border-style: solid;\" >
<tr>
<td width=\"60%\" align=\"left\" ><font face=\"Arial\"><b>Emne</b></font></td>
<td width=\"20%\" align=\"center\"><font face=\"Arial\"><b>Indsendt
af</b></font></td>
<td width=\"20%\" align=\"center\" valign=top><font face=\"Arial\"><b>Dato</b></font></td>
</tr>
<tr>
<td COLSPAN=\"3\" align=\"left\">
<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"2\" bordercolor=\"#FFFFFF\">
<%
While Not rsThreads.EOF
treeMessage_Build rsThreads(\"MessageID\"), 0
rsThreads.MoveNext
Wend
%>
</TABLE>
</tr>
</table>
<P align=\"center\"><font face=\"Arial\"><A HREF=\"post.asp?ForumID=<%= ForumID %>\"><B>
</B></A></font></P>
</TD>
</TR>
</TABLE>
<font face=\"Arial\"><% End If %> <BR>
</font>
<font face=\"Arial\"><!--#include virtual=\"bund.asp\" --> </font>
