asp 新闻调用问题 请各位大哥帮忙看下

来源:百度知道 编辑:UC知道 时间:2024/06/05 13:56:52
<td width="84%" height="19" background="Images/news1.jpg">  业内资讯>>                      <a href="NewsClass.asp?BigClass=业内资讯"><font color="#FFFFFF">more.</font></a></td>
</tr>
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 6 * from news where BigClassName='业内资讯' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<tr>
<td height="62" colspan="2" align="center"><table width="95%" border="0" cellspacing="1" cellpadding="0">
<tr>

i=i+1
if i>=6 then exit do '你漏了这句
loop

依靠这句判断语句,当调满6条新闻,就退出do while语句。
没有这句,就会把所有的记录都调用出来了。

2楼的方法,只要记录不低于6条,应该不会出错。但我的方法考虑了兼容性问题及尽量少改动源代码。

关于IF语句请查询ASP教材,请用标准语句,百度上复制黏贴可能不能正常执行。

要速度快,尽量把图片容量弄小点

是没错阿

改写一下用for i=1 to 6
......
next