将一个 ' 替换为两个 ''a = "select yonghuming,mima from zhuce where yonghuming='"&Replace(textyonghuming.text,"'","''")&"'and mima='"&Replace(textmima.text,"'","''")&"'"
a = "select yonghuming,mima from zhuce where yonghuming='" & textyonghuming.text & "' and 注意:字符串连接符& 至少 要与前后词语间有一个空格!!!!
a = "select yonghuming,mima from zhuce where yonghuming='"&textyonghuming.text&"'and mima='"&textmima.text&"';"
事实上真没觉得这样写有错 你把上下文贴出来看看
在最后加个;应该行了吧