martindavey
Programmer
I am trying to insert into Access using a method of the CDatabase class.
I have a variable that contains a surname that may well contain an apostrophe, eg. O'Reily.
My SQL insert is:
strSQL.Format("insert into [myTable] (Surname) ('%s')",
strSurname );
I get a syntax error on inserting because of the apostrophe in the surname.
I have tried using escaped quotes, and brackets but to no avail.
Removing the apostrophe is not an option.
Thanks, Martin :O|
I have a variable that contains a surname that may well contain an apostrophe, eg. O'Reily.
My SQL insert is:
strSQL.Format("insert into [myTable] (Surname) ('%s')",
strSurname );
I get a syntax error on inserting because of the apostrophe in the surname.
I have tried using escaped quotes, and brackets but to no avail.
Removing the apostrophe is not an option.
Thanks, Martin :O|