我为什么查询出来只显示最后一条记录啊。。求解释啊在线等 急

yudongke 2012-03-07 01:34:18
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="ConstSite.asp"-->

<!--#include file="ConnSite.asp"-->

<!--#include file="Function.Asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="index.css"/>
</head>

<body>
<div id="head">
<table width="260" height="213" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="218" height="23" id="test-link-pdc"><img src="images/yongjie_11.gif" /><span class="STYLE1">最新动态</span></td>
<td width="82" align="right"><img src="images/yongjie_09.gif" /></td>
</tr>
<tr>
<td height="10" colspan="2" align="center"><img src="images/yongjie_19.gif" width="244" height="6" /></td>
</tr>
<tr>
<td colspan="2"><%
set rs=conn.execute("select top 7 ID,NewsName,AddTime from Ameav_News where sortid=19 or sortid=20 and ViewFlag=-1 order by ID desc")
%>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0" class="newslist" style="margin-top:10px; margin-bottom:10px; font-size:13px;">
<%
if rs.bof and rs.eof then
response.Write("<tr><td align=center height=100>暂无信息</td></tr>")
else
do while not rs.eof
%>
<tr >
<td width="219" height="26" align="left" valign="middle" style="border-bottom:1px dashed #CFCFCF; background:url(images/yongjie_26.gif); background-repeat:no-repeat;">
<a style="text-indent:1em;" href="showarticle.asp?id=<%=rs("ID")%>" title="<%=rs("NewsName")%>" target="_blank"><%=Left(rs("NewsName"),17)%></a></td>
<td width="81" align="left" valign="middle" style="border-bottom:1px dashed #CFCFCF;">(<%=formatdatetime(rs("AddTime"),2)%>)</td>
</tr>
<%
rs.movenext
loop
end if
%>
</table>
<%
rs.close
set rs=nothing
%></td>
</tr>
</table>


</div>
</body>
</html>
...全文
96 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yudongke 2012-03-07
  • 打赏
  • 举报
回复
崩溃 就这里 错 了 多谢
三石-gary 2012-03-07
  • 打赏
  • 举报
回复
select top 7 ID,NewsName,AddTime from Ameav_News where sortid=19 or sortid=20 and ViewFlag=-1 order by ID desc
这条语句查出来的结果有几条?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧