Howdy y'all!
I am having heck of a problem with this. I read dozen of postings where this is mentioned and none of the suggestions work for me.
I have an MS Access 2000 table. Fields set to Yes/No. I use check boxes in form with value="1". In the action page, I am using <cfparam .... default=0> for each of the checkbox fields.
Now, when updating the table I get the error:
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (121:5) to (121:65).
I noticed posting where the values are suggested to be set to "true" and then to "false" in <cfparm ...>. Mean while, the ON/OFF switch is set by values of 0 and 1. I have tried both and nothing.
Do I need quotes around variables within <cfquery ... udate> statement?
Can some one please post a simple snip of code I can use to model my own with?
FOLLOWING IS MY QUERY:
<cfif "#form.Action#" IS "EDIT">
<cfquery name="editMyProfile" datasource="HGS" btype="odbc">
update contacts
set ContactFirstName='#form.membFirstName#',
ContactLastName='#form.membLastName#',
ContactCompanyName='#form.membCompany#',
ContactAddr1='#form.membAddr1#',
ContactAddr2='#form.membAddr2#',
ContactCity='#form.membCity#',
ContactState='#form.membState#',
ContactZip='#form.membZipCode#',
ContactPhone='#form.membPhone#',
ContactFax='#form.membFax#',
ContactMobile'#form.membMobile#',
ContactEmail='#form.membeMail#',
ContactWebSite='#form.membWebSite#',
ContactComments='#form.membComments#',
ContactSource='#form.membSource#',
ContactLastRevised='#dateNow#',
ContactHTML=#HTML#,
ContactApparel=#form.membApparel#,
ContactElectronics=#form.membElectronics#,
ContactFurniture=#form.membFurniture#,
ContactShoes=#form.membShoes#,
ContactNovelties=#form.membNovelties#,
ContactDomestics=#form.membDomestics#,
ContactGifts=#form.membGiftItem#,
ContactSunglasses=#form.membSunglasses#,
ContactOfficeEquipment=#form.membOffice#,
ContactHouseware=#form.membHouseware#,
ContactSportingGoods=#form.membSportingGoods#
where ContactEmail = '#form.myOLDID#'
</cfquery>
<cfelse>
<cfquery name="addProfile" datasource="HGS" dbtype="odbc">
insert into contacts(
ContactFirstName,
ContactLastName,
ContactCompanyName,
ContactAddr1,
ContactAddr2,
ContactCity,
ContactState,
ContactZip,
ContactPhone,
ContactFax,
ContactMobile,
ContactEmail,
ContactWebSite,
ContactComments,
ContactPassword,
ContactRegisteredOn,
ContactSource)
values('#form.membFirstname#',
'#form.membLastName#',
'#form.membCompany#',
'#form.membAddr1#',
'#form.membAddr2#',
'#form.membCity#',
'#form.membState#',
'#form.membZipCode#',
'#form.membPhone#',
'#form.membFax#',
'#form.membMobile#',
'#form.membeMail#',
'#form.membWebSite#',
'#form.membComments#',
'#form.MembPassword#',
'#dateNow#',
'#form.membSource#')
</cfquery>
</cfif>
Sorry for the long post ... Any help will be truly appreciated!
Regards;
Jose Lerebours KNOWLEDGE: Something you can give away enlessly and gain more of it in the process! - Jose Lerebours
I am having heck of a problem with this. I read dozen of postings where this is mentioned and none of the suggestions work for me.
I have an MS Access 2000 table. Fields set to Yes/No. I use check boxes in form with value="1". In the action page, I am using <cfparam .... default=0> for each of the checkbox fields.
Now, when updating the table I get the error:
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (121:5) to (121:65).
I noticed posting where the values are suggested to be set to "true" and then to "false" in <cfparm ...>. Mean while, the ON/OFF switch is set by values of 0 and 1. I have tried both and nothing.
Do I need quotes around variables within <cfquery ... udate> statement?
Can some one please post a simple snip of code I can use to model my own with?
FOLLOWING IS MY QUERY:
<cfif "#form.Action#" IS "EDIT">
<cfquery name="editMyProfile" datasource="HGS" btype="odbc">
update contacts
set ContactFirstName='#form.membFirstName#',
ContactLastName='#form.membLastName#',
ContactCompanyName='#form.membCompany#',
ContactAddr1='#form.membAddr1#',
ContactAddr2='#form.membAddr2#',
ContactCity='#form.membCity#',
ContactState='#form.membState#',
ContactZip='#form.membZipCode#',
ContactPhone='#form.membPhone#',
ContactFax='#form.membFax#',
ContactMobile'#form.membMobile#',
ContactEmail='#form.membeMail#',
ContactWebSite='#form.membWebSite#',
ContactComments='#form.membComments#',
ContactSource='#form.membSource#',
ContactLastRevised='#dateNow#',
ContactHTML=#HTML#,
ContactApparel=#form.membApparel#,
ContactElectronics=#form.membElectronics#,
ContactFurniture=#form.membFurniture#,
ContactShoes=#form.membShoes#,
ContactNovelties=#form.membNovelties#,
ContactDomestics=#form.membDomestics#,
ContactGifts=#form.membGiftItem#,
ContactSunglasses=#form.membSunglasses#,
ContactOfficeEquipment=#form.membOffice#,
ContactHouseware=#form.membHouseware#,
ContactSportingGoods=#form.membSportingGoods#
where ContactEmail = '#form.myOLDID#'
</cfquery>
<cfelse>
<cfquery name="addProfile" datasource="HGS" dbtype="odbc">
insert into contacts(
ContactFirstName,
ContactLastName,
ContactCompanyName,
ContactAddr1,
ContactAddr2,
ContactCity,
ContactState,
ContactZip,
ContactPhone,
ContactFax,
ContactMobile,
ContactEmail,
ContactWebSite,
ContactComments,
ContactPassword,
ContactRegisteredOn,
ContactSource)
values('#form.membFirstname#',
'#form.membLastName#',
'#form.membCompany#',
'#form.membAddr1#',
'#form.membAddr2#',
'#form.membCity#',
'#form.membState#',
'#form.membZipCode#',
'#form.membPhone#',
'#form.membFax#',
'#form.membMobile#',
'#form.membeMail#',
'#form.membWebSite#',
'#form.membComments#',
'#form.MembPassword#',
'#dateNow#',
'#form.membSource#')
</cfquery>
</cfif>
Sorry for the long post ... Any help will be truly appreciated!
Regards;
Jose Lerebours KNOWLEDGE: Something you can give away enlessly and gain more of it in the process! - Jose Lerebours