I have a query in one of my forms that should insert a String into a table in an SQL server.
The Query looks like this:
INSERT INTO tablename (KeyF,Text) VALUES (ID,'String')
My problem is that if the string contains a ' character, then access thinks its the end of the string, and throws an error.
Is there any way I can easily pickup on the ' character and either remove it, or put an escape character by it so that it will be correctly entered into the databse.
The string is free text entered by the user, so it is quite likely that someone would enter this charater.
The Query looks like this:
INSERT INTO tablename (KeyF,Text) VALUES (ID,'String')
My problem is that if the string contains a ' character, then access thinks its the end of the string, and throws an error.
Is there any way I can easily pickup on the ' character and either remove it, or put an escape character by it so that it will be correctly entered into the databse.
The string is free text entered by the user, so it is quite likely that someone would enter this charater.