为什么查询出的结果不是前4条数据?

yashiro 2003-06-22 01:23:53
我想查询出前4条数据,可是这样显示出来的却是所以的数据,难道不是用 top 4 吗?

<table>
<%
set cn = server.createObject("adodb.Connection")
cn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("./forum.mdb")
set h_rs = server.createobject("adodb.recordset")
h_sql = "select top 4 t_subject from forum_topic order by t_reply_count desc"
h_rs.open h_sql,cn,3,3
while not h_rs.eof
%>
<tr><td><%=h_rs("T_Subject")%></td></tr>

<%
h_rs.movenext
wend
h_rs.close
%>
</table>
...全文
42 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
叶子哟 2003-06-22
  • 打赏
  • 举报
回复
看不出什么问题呀?
pimple 2003-06-22
  • 打赏
  • 举报
回复
select top 4 T_Subject from froum_topic order by t_reply_count desc
chen8967 2003-06-22
  • 打赏
  • 举报
回复
你理想中的前4条和实际输出的前4条有什么不同?然后查找原因
nboys 2003-06-22
  • 打赏
  • 举报
回复
h_sql = "select top 4 t_subject from forum_topic order by t_reply_count desc"

这样写没有错误的
xuya 2003-06-22
  • 打赏
  • 举报
回复
select top 4 from forum_topic order by t_reply_count desc"

28,391

社区成员

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

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