vb中,sql语句的单引号和双引号使用问题?

2024-12-01 07:24:10
推荐回答(4个)
回答1:

将一个 ' 替换为两个 ''a = "select yonghuming,mima from zhuce where yonghuming='"&Replace(textyonghuming.text,"'","''")&"'and mima='"&Replace(textmima.text,"'","''")&"'"

回答2:

a = "select yonghuming,mima from zhuce where yonghuming='" & textyonghuming.text & "' and 注意:字符串连接符& 至少 要与前后词语间有一个空格!!!!

回答3:

a = "select yonghuming,mima from zhuce where yonghuming='"&textyonghuming.text&"'and mima='"&textmima.text&"';"

事实上真没觉得这样写有错 你把上下文贴出来看看

回答4:

在最后加个;应该行了吧