I didn't figure it was a bug, just couldn't see the reason for the behavior.

What still doesn't seem to make sense is that using the trim() in the
cfqueryparam value does add an additional apostrophe, but not using trim()
doesn't. (In MX, at least.) I've used preserveSingleQuotes so doesn't
escape; but, haven't seen that as necessary when cfqueryparam is used. (Are
you suggesting to set the cfqueryparm
value="#PreserveSingleQuotes(formValue)#" ?)

I began using the HTMLEditFormat for generated form values in either 4 or 5
because if someone used an apostrophe and this went directly to the database
as such, it truncated the entry at the spot of the apostrophe. Using
HTMLEditFormat was recommended somewhere along my learning and it worked to
prevent this truncation.

Thanks for the explanation.

Keith

E. Keith Dodd
Wings of Eagles Services
www.wingserv.com
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, February 23, 2003 12:56 PM
Subject: unexpeted result with cfqueryparam


> 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 (&lt; 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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to