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
news表的id字段是Integer型的,title字段是nvarchar(50)型的,執行的結果是把news表中id字段為10的記錄的title字段的內容改成“1'2'3”