asp显示问题只显示6条怎么全部显出来

来源:百度知道 编辑:UC知道 时间:2024/09/25 11:25:56
<%

id="15"

tt="select top 6 id,x_name,x_leiid,x_baojia,x_top from xianlu order by x_top desc"

tt="select id,x_name,x_leiid,x_baojia,x_top from xianlu where x_leiid="&id&" order by x_top desc"

set er=conn.execute(tt)
while not er.eof
%>
<%

id="15"

tt="select top 4 id,x_name,x_leiid,x_baojia,x_top from xianlu where x_leiid="&id&" order by x_top desc"

set er=conn.execute(tt)
while not er.eof
%>
合成一条也不行,也是全部都显示出来了

请使用
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
的方式来获取记录集

这样不行吗?你补充的应该可以的!

你用的不是ACCESS吧?否则取数据集时可以用

set er = server.createObject("ADODB.Recordset")
er.open tt,conn,1,1
试试看,一般使用execute是不用返回值的,如果添加更新,查询记录的条数。也就是说execute可能返回的就是整个数据集,与具体的SQL无关吧?

我也不太清楚,但我总是喜欢用OPEN函数打开数据集的!

tt="select top 6 id,x_name,x_leiid,x_baojia,x_top from xianlu order by x_top desc"

tt="select id,x_name,x_leiid,x_baojia,x_top from xianlu where x_leiid="&id&" order by x_top desc"

这2个要合成一个

是否是主键问题?你设写一下主键看看(ID)