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

apostrophe trouble

Status
Not open for further replies.

Sveno

Technical User
Jan 8, 2002
27
AU
Hi,

I am attempting to check first name and surname details from an Access table (from a recordset) against names held in an ORACLE database and am having trouble when the surname contains an apostrophe.

The code I am using is:
SELECT * FROM CLIENT (ODBC table) WHERE FIRST_NAME =
'" & RS!FIRST_NAME & "' AND SURNAME = '" & RS!SURNAME & "'"

I have tried:
AND SURNAME = '" & REPLACE(RS!SURNAME,"'","''") & "'

and also:

AND SURNAME = " & chr$(34) & RS!SURNAME & chr$(34) & "

to no avail. Any suggestions would be greatly appreciated.

Cheers

Mark
 
Thank you for replying, I am still getting the error though. I use the replace statement in SQL server and it works , so this may be something to do with ORACLE.

I am going to ask for permission to create temporary table directly on the ORACLE database, so this will eventually solve the problem.

Cheers

Mark
 
ORACLE uses single quotes/apostrophes for strings.

TomCologne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top