Sorry for the OT post, but the forums absolutley STINK, and I think you guys
are more competent than the rest of the CF world anyway. :-}

I'm getting the following error when I try to use cfloop to insert multiple
records.

****************************************************************************
ODBC Error Code = 37000 (Syntax error or access violation)

[Microsoft][ODBC Microsoft Access Driver] Invalid bracketing of name
'[attributes.OptID1]'.

The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (6:1) to (9:37).
****************************************************************************

I've tried to change my syntax every way I can imagine.  Here's my code:

<cfloop index="i" from="1" to="#attributes.OptionQty#">

<cfquery
 datasource="#attributes.dsn#"
 username="#attributes.dsnUsername#"
 password="#attributes.dsnPassword#">
 INSERT INTO Options
  (PrID,
   OptID,
   OptValue,
   OptPrice,
   OptWeight,
   OptOrderBy)
 VALUES
  (#attributes.ProductID#,
   Evaluate("attributes.OptID#i#"),
   'Evaluate("attributes.OptValue#i#")',  <!------------------------------
Getting stuck here ------>
  <cfif Not CompareNoCase(Evaluate("attributes.OptPrice#i#"), "")>
   0,
   <cfelse>
   Replace(Evaluate("attributes.OptPrice#i#"), "$", "", "ALL"),
   </cfif>
   <cfif Not CompareNoCase(Evaluate("attributes.OptWeight#i#"), "")>
   NULL,
   <cfelse>
   Evaluate("attributes.OptWeight#i#"),
   </cfif>
   <cfif Not CompareNoCase(Evaluate("attributes.OptOrderBy#i#"), "")>
   NULL)
   <cfelse>
   Evaluate("attributes.OptOrderBy#i#"))
   </cfif>
</cfquery>

</cfloop>

Thanks,

Brad Roberts



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

Reply via email to