主要是Command对象以及CreateParameter方法、配合Recordset、AppendChunk方法的使用。
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandType = 1
Cmd.CommandText = "DELETE FROM shop WHERE brandname = ? AND nickname = ?"
Cmd.Parameters.Append(Cmd.CreateParameter("brandname", 200, 1, 30, brandname))
Cmd.Parameters.Append(Cmd.CreateParameter("nickname", 200, 1, 30, nickname))
Cmd.Execute
Set Cmd = nothing
'----------------------------------------------
Set Cmd = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
' 品牌信息
Cmd.ActiveConnection = Conn
Cmd.CommandType = 1
Cmd.CommandText = "SELECT * FROM brand WHERE brandname = ?"
Cmd.Parameters.Append(Cmd.CreateParameter("brandname", 200, 1, 30, brandname))
RS.CursorType = 1
RS.LockType = 3
RS.Open(Cmd)
RS("catid") = catid
RS("cname") = cname
RS("official") = official
RS("logo") = logo
RS("otherurl").AppendChunk(otherurl)
RS("intro").AppendChunk(intro)
RS.Update
RS.Close
Set RS = nothing
Set Cmd = nothing