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”
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com