代码如下:
Dim conn,cmd,pra
set cOnn=server.createobject("adodb.connection")
conn.Open "…………" '这里省略数据库连接字
set cmd=server.createobject("adodb.Command")
set pra=server.createobject("adodb.Parameter")
cmd.ActiveCOnnection= conn
cmd.CommandText = "update news set title=? where id =?"
cmd.CommandType = adCmdText
Set pra = cmd.CreateParameter("title", adVarWChar, adParamInput, 50, "1'2'3")
cmd.Parameters.Append pra
Set pra = cmd.CreateParameter("id", adInteger, adParamInput, , 10)
cmd.Parameters.Append pra
cmd.Execute