How to "escape" a whole String - an SQL query

Posted by Ankur on Stack Overflow See other posts from Stack Overflow or by Ankur
Published on 2010-05-14T08:18:24Z Indexed on 2010/05/14 8:24 UTC
Read the original article Hit count: 475

Filed under:
|
|

When I add a relative path to an SQL query as a String all the \ get removed.

I am trying to add the String ("pics\\"+onlyFile) and as you can see I have escaped the \ character so I don't understand why it is being removed. onlyFile is a variable containing a file name.

The value of the "src" variable (the one I am discussing) just before the SQL statement is correct, hence it is something happening when it is added to the SQL query.

© Stack Overflow or respective owner

Related posts about sql

Related posts about escaping