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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for names containg the ' char 2

Status
Not open for further replies.

Boorgy

Programmer
Jul 13, 2001
14
IE
Hi again,

Ok, the thing I forgot to mention is that I am using SQL in a VB6 application. Now the "O'Connor" thing doesn't work, no more than using brackets and lots of other things I've tried...
So if you have the answer, or if you know someone who's likely to, please help!!!

Boorgy
 
The Source Table:

ContributorID ContLastName ContFirstName

1 Doe John
2 Smith Roberg
0 Mary O'Conner

The Sql Statement:
SELECT tblContributitor.ContFirstName
FROM tblContributitor
WHERE (((tblContributitor.ContFirstName)="O'Conner"));


The Query Results:

ContFirstName

O'Conner

All of which should be able to be done in any valid SQL situation. MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Try using two single quotes in the place of the single quote in the name - O''Connor. Don't use double quotes if you are connecting with ODBC.

Check these articles.

Terry Broadbent
Please review faq183-874.

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top