Manage quotes inside string VBA

♀尐吖头ヾ 提交于 2019-12-18 09:49:08

问题


I trying to insert to Access Table some values that I getting from another table, the problem is that some values comes with quotes and double quotes inside the string, like this example:

str1 = "Non-fusible sectionalizing "green' low rise switch."

How can I manage quotes inside string in VBA for Access 2010 for can insert it into table?


回答1:


From memory I think you just need to double them up to look like this:

str1 = "Non-fusible sectionalizing ""green' low rise switch."

You can perform a Replace on the string using Chr(34) - the " character:

str1 = Replace(str1, Chr(34), Chr(34)&Chr(34))


来源:https://stackoverflow.com/questions/20400068/manage-quotes-inside-string-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!