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

Access SQL with strings containing single quotes

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I'm using CF 4.5 and querying an Access2000 database. I am trying to query the database to return records that match a string value list. however, some of these elements contain single quotes. I can't seem to force a differentiation between the single quotes that separate the elements and those that are contained in the string, especially since CFQUERY seems to require that string elements are specfied by a single quote. Some examples of things that I've tried but don't work:

results.CHEMICAL IN ('1,1'- biphenyl, 2,2'- diethyl-')

results.CHEMICAL IN ("1,1'- biphenyl, 2,2'- diethyl-")

((results.CHEMICAL= '1,1'- biphenyl, 2,2'- diethyl-'))

((results.CHEMICAL= "1,1'- biphenyl, 2,2'- diethyl-"))

<cfset chemical = &quot;1,1'- biphenyl, 2,2'- diethyl-&quot;>
#PreserveSingleQuotes(chemical)#

Help would be greatly appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top