This behavior isn't a bug, although I can't explain why your code works in CF 5.
CF's normal behavior is to escape a single quote contained in a SQL string value by doubling it. This is true whether you use the Trim() function or not. So you'll want to use PreserveSingleQuotes() to prevent CF from automatically escaping the single quotes in your SQL string values. The HTMLEditFormat function is used to preserve specific special characters (<>&") that are used inside CFOUTPUT tags by converting them to HTML codes (< etc.). But this function preserve *double* quotes, not single quotes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

