Click to See Complete Forum and Search --> : How to escape apostrophe's that are going into Access database


mparker1113
02-16-2007, 02:57 PM
I have some fields where I collect the info from a form, then insert the data into Access.

I have tried to use Replace() to replace occurences of " ' " with /' or \' , but that doesn't solve the problem. I still have the program crash every time a line is written which has an apostrophe in it.

Error message is:

Syntax error (missing operator) in query expression

gil davis
02-16-2007, 03:19 PM
You have the right idea, just the wrong delimiter. Replace "'" (a single apostrophe) with "''" (two apostrophes) and you'll be good to go.