谁能帮我优化一下asp代码

来源:百度知道 编辑:UC知道 时间:2024/09/22 20:17:03
现在老是访问asp代码的网页很慢 ,请大家帮忙解决啊,20分全给你们
disp代码如下:
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="20"> ¤ <a href="/list.asp?class=<%=aclass%>"><%=aclass%></a> ----<a href="hbsh.asp">返回首页</a> ¤ </td>
</tr>
<tr>
<td height="10"><div align="center"><B><br>
<span class="style4"><%=rs("title")%></span><br>
</B></div></td>
</tr>
<tr>

最后加上
<%
rm.close
set rm=nothing
%>

我现在看不到你的asp语句怎么写的,上面的同仁说的应该是一方面。
另外就是你的表格设置。是不是在一个大表格里了,影响了读取的时间。
其它的,我都看不到,只是猜策。
请把原码贴出来。

rm 记录集的sql语句改变一下
写成 select top 1 * from table where id > cint(id)

原因是,你的 下一条 链接的计算耗了太多的时间

同意楼上的意见 下一条 链接的计算耗了太多的时间
其实你可以直接使用rs.movenext使用
rm.movefirst
for i = 1 to rm.recordcount
if rm("id")=cint(id) then exit for
rm.movenext
next

似乎是多余的。因为你在使用当前在条纪录时,指针只要再往后移动一条纪录就指向下一条了,何必使用那个for循环呢!