View Full Version : Apostrophe in SQL Statement


VBStudent
04-03-2002, 12:38 AM
I am designing a datbase using Access 97. I am wrting code to make it more user friendly. I have a search facility which works by using an SQL statement to retrieve names from the Database, however I cannot serach for any name with an apostrophe. Can anyone help?

cpod
04-03-2002, 06:12 AM
Just use double quotes:

"SELECT [table 1].* FROM [table 1] WHERE [table 1].textfield=""" & strText & """;"