>I'm new to ColdFusion and although I'm finding it generally easy going I'm
>having some troubles using CFINSERT to populate an Access database table.
>The trouble is that ColdFusion seems to be interpreting my Submit button as
>another form field in which it should be entering a value in the database
>table. Since I don't have a column in my database called 'SubmitForm' I'm
>getting the following error:

that's one of the limitations of using CFINSERT...all the fields in the
form will be used in the insert statement. however, you could use the
CFINSERT field's FORMFIELD attribute to explicitly name each field you want
to insert.

the general recommendation, however, is to use a CFQUERY tag with a SQL
insert statement rather than using CFINSERT because the former is much much
more flexible and is quicker.

<CFQUERY DATASOURCE="YourDSN">
INSERT INTO TableName (field1, field2, field3)
VALUES (#FORM.field1#, #Form.Field2#, #Form.Field3#)
</CFQUERY>

just remember that string fields must have single quotes around them in the
values. -emily

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to