Escaping quotes in a string in VB6

后端 未结 7 603
日久生厌
日久生厌 2020-11-29 11:01

I am trying to make some small changes to an old VB web app I need to add quotes inside of a string I\'ve had no luck so far. The string is

Dim sql As Stri         


        
7条回答
  •  星月不相逢
    2020-11-29 11:49

    Most SQL servers, in my experience, need a single quote for strings. The best way to do it is to let .net deside for you, by using SQL Parameters. Here's a sample (also in VB.Net): http://www.knowdotnet.com/articles/dynamicsqlparameters.html
    This also has the benefit of security against SQL injections.

提交回复
热议问题