SQL Select string where search criteria contains a ' character? [RESOLVED FISH]
I have a surname in my DB, which is:
O'Keafe
But if I build a search SQL string like:
Code:
SELECT * FROM tblUsers Where Surname = 'O'Keafe'
then this gives an error :(
Any ideas?
Woka
Re: SQL Select string where search criteria contains a ' character? [RESOLVED FISH]
i have the same case ..
but im about to search in a database
i created a table named tblBook, with fields BookId BookName and Copyright,i have a record on BookName which is One's Self
"Select BookId From tblBook where BookName like '" & txtBookName.Text & "' "
i have this code in visual basic 6.0..
errors occur about the apostrophe sign (')
Re: SQL Select string where search criteria contains a ' character? [RESOLVED FISH]
Welcome to VBForums :wave:
Please do not reply to old threads just because they have a similar issue. For a variety of reasons it is better to create a new thread instead, and if apt link to the old one.
For information on how to solve the issue, see the article How do I put the ' character into an SQL string? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)