日期:2014-05-17  浏览次数:23468 次

ASP后台怎么实现文章置顶
不要跟我说排序,我想要的点击“置顶”后,怎么将这个动作告诉后台,然后后台怎么更新数据库那段程序,就是更新数据库置顶字段的那段,我不太懂ASP,麻烦高手给我一段代码看看,或者有相关例子

------解决方案--------------------
VB code
set rs=server.createobject("adodb.recordset")
sql="update wys set hits=hits+1 where id="&request("id")
rs.open sql,conn,1,3

------解决方案--------------------
Sql = "Select * From Z_Article Where D_ID > 0 order by isTop desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,Conn,3,1


置顶
Sub isTop()
Conn.Execute ("update Article set isTop=1 where D_ID in (" & selArticleID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
取消置顶
Sub noTop()
Conn.Execute ("update Article set isTop=0 where D_ID in (" & selArticleID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub