ASP 去掉查询结果中的最后一项 其它结果显示出来

来源:百度知道 编辑:UC知道 时间:2024/06/06 16:55:49
我自己 的代码是全部结果都显示出来的 我想把最后一项结果去掉怎么弄
<% Sql = "select baobiaoym from "&bb_tablename&" where qyxx_id="&qyxx_id&" group by baobiaoym order by baobiaoym asc"
Set Rs1 = Server.CreateObject ("ADODB.Recordset")
Rs1.Open Sql,Con,3,3
if not Rs1.eof then
niucount=1
countnum=6
while not Rs1.eof
baobiaoym=Rs1("baobiaoym")
if niucount=1 then
%> <tr>
<% end if
%>
<td valign="top"><a href="<%=bb_numble%>_show.asp?qyxx_id=<%=qyxx_id%>&baobiaoym=<%=baobiaoym%>" target="_blank"><%=baobiaoym%></a></td>
<%
if niucount=countnum then
niucount=0
%> </tr>
<% end if
Rs1.MoveNext
niucount=niucount+1
wend
else
%>
能加点中文说明吗

<% Sql = "select baobiaoym from "&bb_tablename&" where qyxx_id="&qyxx_id&" group by baobiaoym order by baobiaoym asc"
Set Rs1 = Server.CreateObject ("ADODB.Recordset")
Rs1.Open Sql,Con,3,3
'//////////////////
rCount = rs1.recordcount'总的记录数
i = 0
'//////////////////
if not Rs1.eof then
niucount=1
countnum=6
while not Rs1.eof
baobiaoym=Rs1("baobiaoym")
if niucount=1 then
%> <tr>
<% end if
%>
'////////////
i = i + 1 ' i每次加1就读取一条记录
if i < rCount then 'i小于总记录数,就显示,等于总记录数,相当于最后一条记录,就不显示,大于是不可能的了
'////////////

<td valign="top"><a href="<%=bb_numble%>_show.asp?qyxx_id=<%=qyxx_id%>&baobiaoym=<%=baobiaoym%>" target="_blank"><%=baobiaoym%></a></td>
<%
'////////////
end if