use:
<cfqueryparam cfsqltype="cf_sql_varchar"  value="#form.product_name#">

and it should take care of the problem

It is a change in behavior between CF5 and CFMX

Thanks
Marius Milosav
www.scorpiosoft.com
It's not about technology, it's about people.
Virtual Company (VICO) Application Demo
www.scorpiosoft.com/vicodemo/login.cfm



----- Original Message -----
From: "Bud" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 7:51 PM
Subject: CFMX Insert query problem


> Hi All. I'm receiving an error on a database INSERT...
>
> [MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC
> Microsoft Access Driver] Syntax error (missing operator) in query
> expression ''Bud's Maid Service',etc...
>
> from the single quote in Bud's. If I escape the quote with another
> quote, there's no problem. The value I'm entering is simple:
>
> INSERT INTO Products
> (Product_Name,Etc...)
> VALUES
> ('#form.product_name#',etc...)
>
> Does anyone know if this error would be cause by the JDBC driver
> itself? Or by CFMX? Just curious before I report the error to Crystal
> Tech.
>
> Now, I understand that if I was hard coding it in, I'd have to write it
like...
>
> INSERT INTO Products
> (Product_Name,Etc...)
> VALUES
> ('Bud''s Maid Service',etc...)
>
> I can fix it by doing...
>
> #replace(form.product_name, "'", "''", "ALL")#
>
> But then of course on all "non-broken" systems it will be inserted as
> "Bud''s Maid Service".
>
> The UPDATE query works correctly with the same variable...
>
> UPDATE Products
> SET
> Product_Name='#form.product_name#',etc...
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> http://www.cf-ezcart.com/
> 954.721.3452
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

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

Reply via email to