《实例精粹ASP》中部分源代码
源代码在线查看: faqmodifysave.asp
dim strSQL, cmdObj, rsObj
dim nID
nID = RealString(Request.Form("id"))
Set cmdObj = Server.CreateObject("ADODB.Command")
Set rsObj = Server.CreateObject("ADODB.RecordSet")
cmdObj.CommandText = "SELECT top 1 * FROM faq WHERE id = " & nID
cmdObj.CommandType = adCmdText
Set cmdObj.ActiveConnection = conn
rsObj.Open cmdObj, , adOpenKeyset, adLockOptimistic
rsObj("question") = Request.Form("question")
rsObj("answer") = Request.Form("answer")
rsObj.Update
' Response.Write rsObj("id")
' Response.End
' rsObj.movelast
%>
alert("修改成功!");
window.location = ""
-->
rsObj.Close
set rsObj = nothing
CloseConn()
%>