Click to See Complete Forum and Search --> : Single Quote Problem.....HELP


January 18th, 2000, 04:56 AM
Hi all,
I have this problem with single quotes in my program. I have a name ie. D'Souza and when i use an update statement to enter any data into my database i get an error due to the conflict in the update statement.
eg : Sql = "Update employees set employeeFirstname=' "& text1.text &" ',etc..etc"
So since i have a single quote in the sql, it conflicts with the single quote in the name D'Souza and gives me the error.
I would be grateful if you guys out there could help me out with this, thanks alot in advance.
Derek

Crazy D @ Work
January 18th, 2000, 05:03 AM
Make the single quotes ' to 2 single quotes '' ... If you have VB6, you can easily use the Replace$ function:
s = Replace$(s, "'", "''")
This should work (at least it does for me)

Crazy D @ Work :-)