Interesting you're abandoning CFINSERT, Rick.  In all the time I've been
using ColdFusion, I never once managed to make it work.  I always got
SQL errors. I assumed it was because I had a Identity primary key in my
tables and CFINSERT wouldn't work without every field in the table being
defined.  (if you have a Identity field, the table generates that by
itself and wont let you insert a value into there).

So what's the trick with CFInsert then?  How do you make it work?


Cheers,
Michael Kear
Windsor, NSW, Australia
AFP Webworks.





-----Original Message-----
From: Rick Faircloth [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, 28 December 2002 4:06 AM
To: CF-Talk
Subject: Best way to handle Checkboxes with Insert Query?

Hi, all.

So I've abandoned CFINSERT in favor of CFQUERY Insert Into...
And am now using <cfqueryparam> to handle the values of the
formfields...
The problem is now checkboxes...

When using CFINSERT, it didn't matter that a Checkbox was unchecked and
therefore the formfield didn't exist.  With the CFQUERY Insert approach,
if a checkbox formfield is unchecked, the formfield is unrecognized.
If I use #ParameterExists(Form.Checkfield)# to check for the formfield's
existence,
and it doesn't exist, and the <cfqueryparam> line which establishes that
value
for the Insert doesn't get processed, the number of formfields vs values
doesn't match.

I've read on this list that it's recommended to use #IsDefined()# in
place
of #ParameterExists()#,
but doesn't IsDefined assume the existence of the variable, and
therefore
doesn't check
for the existence as does ParameterExists?  CFPARAM? And why has
ParameterExists become deprecated
as a function anyway?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Reply via email to