FUNCTION CheckString (s) as String
pos = InStr(s, "'")
While pos > 0
s = Mid(s, 1, pos) & "'" & Mid(s, pos + 1)
pos = InStr(pos + 2, s, "'")
Wend
CheckString="'" & s & "'"
END FUNCTION
以后在动态生成 Select 语句, 使用:
SqlString = "Select * from myBas where Name = " & CheckString(Text1)
处理Select语句中的单引号
最新推荐文章于 2021-10-23 23:53:02 发布