> It works fine as long as there is data in every form field. If a
> form field is blank, however, CF throws up.

It's actually the database throwing up because the resulting SQL is
invalid.  There are a couple of things you can do, but the one
suggestion which should solve the problem is to use CFQUERYPARAM.
This is much safer and will help to prevent SQL injection attacks,
among other things.  Change:

SET Name='#form.Name#'

To:

SET Name = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.name#" />

Do that for all of the values being passed in and set the appropriate
cfsqltype for the field type in the database and it will generate SQL
which the database can handle.  Here is Adobe's CF9 page for the tag:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f6f.html


-Justin Scott

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343436
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to