Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quote as a part of string in a SQL statement

Status
Not open for further replies.

amarti44

Programmer
Feb 16, 2001
23
0
0
US
Hi:

I hope somebody can help me. I'm new to SQL and I'm trying to send an SQL string in VB like this"

MySQL = "SELECT * FROM Visitor WHERE Last_name LIKE 'O'Farriel'.....

where O'Farriel is a last name with a single quote as part of the last name.
How can I make the SQL statement to understand the entire last name and not only 'O'.

Thanks in Advance

Alberto
 

Put two single quotes together.

MySQL = "SELECT * FROM Visitor WHERE Last_name LIKE 'O''Farriel'....." Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top