PDA

View Full Version : Fixing a string for SQL query


dsylebee
11-30-2009, 04:58 PM
Hi everyone I have a litle problem with something I need a function that returns a fixed string, this way my returned string containts the escape string for MS Access.


here is my example :)


string City = "Rue D'Abervmovich";

I need to be able to have a function which returns a string and ads a ' when there is a '

so my function would return

Rue D''Abervmovich

I have

City = FixDbsyntax(City);

:)

oracleguy
11-30-2009, 06:30 PM
Whatever language you are using, the string class probably has a replace method, you can use that to fix the SQL query.

dsylebee
12-01-2009, 10:27 PM
Whatever language you are using, the string class probably has a replace method, you can use that to fix the SQL query.

I just used a tokenizer and a vector at the end wasn't so hard thanks anyways :D