SQL Server 中Update的问题?
giszj 2004-09-20 06:19:46 本人用ADO连接了Sql server后,要对表A中符合条件的记录的字段X的值更改
如下:
dim con as new adodb.connection
....
dim str as string
dim mysql as string
str="myvalue"
mysql="update A set x=" & str & "2" & "where x=" str
con.execute mysql
问题来了:
程序老是提示”列名myvalue2无效?!“
天哪我的值怎么成了列名了呢?
即窗口中的值:update A set x=myvalue2 where x=myvalue
怎么不是:update A set x='myvalue2' where x='myvalue'
请问究竟是怎么回事啊?如何解决这个问题呢?