>- see footer for list info -<
Your problem is with the date format, first up, you don';t need the quotes
around dates, so try...

<cfset query_string = "INSERT INTO tblDailyRates VALUES (#Date# " />

If that still throws an error try

<cfset Date = createODBCDate(top.xmlAttributes.time) />
Instead of your dateformat line.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Shawn Fawcett
Sent: 15 March 2006 05:38
To: Coldfusion Development
Subject: [CF-Dev] parsing xml and inserting into Access2000

>- see footer for list info -<
I'm trying to get the code below to insert data 
into a currency rate table. The table fields are: 
ID (autonumber), Date, USD, JPY, CYP, and another 
30 odd currencies. I'm getting the following 
error: "Error Executing Database Query. 
[Macromedia][SequeLink JDBC Driver][ODBC 
Socket][Microsoft][ODBC Microsoft Access Driver] 
Syntax error (missing operator) in query expression '''2006-03-14'''. "

not quite sure what I'm missing here.
thanks for any help,
Shawn


   <cfhttp 
url="http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; method="get" />
   <cfset xml = XMLParse(cfhttp.filecontent) />
   <cfset top = "#xml.xmlRoot.Cube.Cube#" />
   <cfset Date = DateFormat(top.xmlAttributes.time,"yyyy-mm-dd") />
   <cfset query_string = "INSERT INTO tblDailyRates VALUES ('#Date#'" />
   <cfloop index="i" from="1" to="#ArrayLen(top.xmlchildren)#">
      <cfset child = top.xmlchildren[i] />
      <cfset query_string = query_string & ",'#child.xmlattributes.rate#'"
/>
   </cfloop>
   <cfset query_string = query_string & ")" />
   <cfquery name="q_addCurrency" 
datasource="#application.DS#" 
username="#application.dbuser#" password="#application.dbpass#">
   #query_string#
   </cfquery>



ARAXI Traductions France
100 Passage Henri Régnault - 92400 Courbevoie La Défense 6
Tél. : 01 49 03 41 49 - Fax : 01 49 03 41 42  
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<



_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to