《实例精粹ASP》中部分源代码
源代码在线查看: manumodifysave.asp
dim cmdObj, rsObj
dim szName, nID
szName = RealString(Request.Form("name"))
nID = RealString(Request.Form("ID"))
'注:此处省略对szName和nID是否为空的判断,实际中需加上!
Set cmdObj = Server.CreateObject("ADODB.Command")
Set rsObj = Server.CreateObject("ADODB.RecordSet")
cmdObj.CommandText = "SELECT * FROM ProductType WHERE id = " & nID
cmdObj.CommandType = adCmdText
Set cmdObj.ActiveConnection = conn
rsObj.Open cmdObj, , adOpenKeyset, adLockOptimistic
rsObj("name") = szName
rsObj.Update
rsObj.Close
set rsObj = nothing
CloseConn()
%>
alert("修改成功!");
this.document.location = "manuList.asp?id=";
-->