<%
set rs = server.CreateObject("adodb.recordset")
sql = "select top 5 * from article order by ID desc"
rs.open sql,conn,1,3
%>
用的access数据库,前面已经连接了数据库,要倒序输出<%=rs("title")%>
后面的代码怎么写?请高人指点。
參考答案:sql = "select top 5 * from article order by ID desc"
这句中的order by ID desc已经是用ID“倒序”排序了
下面输出就是了
Do while not rs.eof
response.write rs("title")
rs.movenext
loop
如果你觉得现在是“正序”,不妨用order by ID asc