It looks as if you have setup an auto incrementing field as your id field
but tried to pass it in anyway.  I would say, eliminate the athid from the
insert statement and all should be well.  Like this...

<CFQUERY NAME="reg_ath" DATASOURCE="name" DBTYPE="ODBC" >

INSERT INTO ATHLETES (athFirstName, athLastName, athAge, AthEmail ,
athStreet , AthCity , athState, athZip, athgoals )

VALUES ('#FORM.athFirstName#', '#FORM.athLastName#'  ,
#FORM.athAge # ,'#athEmail#',  '#FORM.athStreet#' ,  '#FORM.athCity#' ,
'#FORM.athState#' , #FORM.athZip#, ' #FORM.athGoals# ')

</CFQUERY>

Also remove the hidden field...

Regards,
Neil
-----Original Message-----
From: CF_JONNY [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 4:12 PM
To: CF-Talk
Subject: <<<>>> SQL Question


When inserting a new record I get an error saying that the autoID fields
cannot use a null value.

how do I write the sql like this?

<CFQUERY NAME="reg_ath" DATASOURCE="name" DBTYPE="ODBC" >

INSERT INTO ATHLETES (athid, athFirstName, athLastName, athAge, AthEmail ,
athStreet , AthCity , athState, athZip, athgoals )

VALUES (#Form.athId#, ' #FORM.athFirstName#', '#FORM.athLastName#'  ,
#FORM.athAge # ,'#athEmail#',  '#FORM.athStreet#' ,  '#FORM.athCity#' ,
'#FORM.athState#' , #FORM.athZip#, ' #FORM.athGoals# ')

</CFQUERY>


On form page;

   <input type="hidden" name="athid">


JON



_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com




______________________________________________________________________
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to