On 3/3/03, Marius Milosav penned:
>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
Hi. Nope, that doesn't do it Marius. That breaks the UPDATE statement.
On INSERT
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.product_name#"> works.
#form.product_name# throws an error.
On UPDATE
#form.product_name#
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.product_name#"> inserts double apostrophes (Bud''s Maid
Service).
Any clues?
> > 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
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