本文提供给大家学习的是有关记录排序的ASP实例代码分享,希望能对大家有所帮助。
一,显示纪录
set rs=server.createobject("adodb.recordset")
sql="select * from jfnewso where newsclass='理论动态' and classname='"&Session("fenlei")&"' order by Displayorder desc,id desc "
rs.open sql,conn,1,1
二,修改排序
<%
if request("action")="ORDERUP" then
'排序向上
set rs=server.createobject("adodb.recordset")
sql="select * from jfnewso where id='"&request("id")&"'"
rs.open sql,conn,3,2
rs("DisplayOrder")=rs("DisplayOrder")+1
rs.update
rs.close
set rs=nothing
response.write "<script language=java script>alert('编辑成功!');location.href('?action=liebiao&fenlei="&request("fenlei")&"&xiangmu="&request("xiangmu")&"');</script>"
end if
%>