ASP连ACCESS 用 select top 搜出条数不对,求解
此段代码为了实现读出最近的七条 且推荐的优先输出 现在问题来了,免费域名的全部都输出来了
求大侠能为我改下,我只要输出最近七条,且推荐的优先输出
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 7 * from wdata where wclass='免费域名' order by wpermissions desc"
rs.open sql,conn,1,1
do while not rs.eof
if rs("wpermissions")>0 then
%>
<tr>
<td width="30" height="30"><img src="image/t.png"></td>
<td width="220" height="30">
<a href="index_w.asp?id=<%=rs("id")%>">
<%if rs("wpermissions")=2 then%>
<font size="3" color="red"><%=mid(rs("wtitle"),1,10)%>..</font>
<%else%>
<font size="3" color="#000000"><%=mid(rs("wtitle"),1,10)%>..</font>
<%end if%>
</a>
<td width="80" height="30"><%=rs("wdate")%></td>
</td>
</tr>
<%
else
end if
rs.movenext
loop
rs.close
set rs=nothing
%>