I think you need to escape (i.e. double up) the single quotes in any
CF vars you're using in the query, then use preservesinglequotes()
inside cfquery tag.
<cfscript>
mySQLstring = "SELECT orders_id FROM Orders WHERE label =
'#Replace(This_Label, "'", "''", "all")#'";
</cfscript>
<cfquery name="qwe" datasource="myDsn">
#PreserveSingleQuotes(mySQLstring)#
</cfquery>
Cheers
Bert
On Wed, 8 Dec 2004 18:08:02 -0500, C. Hatton Humphrey
<[EMAIL PROTECTED]> wrote:
> > Why not just double up the single quotes?
>
> Tried that - may be a NDA thing or just a MySQL thing - I got the same
> error when sending the query.
>
> To answer Barney's question - I'm using a MySQL database. That's what
> the clent has and I haven't been able to dissuade him from using it.
>
> When I sent the query "select orders_id from orders where label =
> '#This_Label#' ..." I get a SQL error showing the doubled-up quotes.
>
> Hatton
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186764
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54