...

View Full Version : Help needed with Currency converter...



Confused!
02-08-2005, 07:01 PM
I'm following a tutorial in ColdFusion in order to make a currency converter.

It can be found at http://www.developer.be/index.cfm/fuseaction/tutorialDetail/GroupID/65/tutorialName/Introduction_to_ColdFusion_Part_1_-_ColdFusion_Basics_and_Your_First_Application.htm the thing is, at the part where it says I should use SQL and a cfquery tag to insert the data into the table. For example...


While we are creating our database why don't we use some SQL (Structured Query Language) and a CF tag, <CFQUERY> to insert our data into the table.

To get ColdFusion to insert records (rows) into a database we should use the following syntax. Create a new template and run this script. Don't forget to set up a datasource to your MS Access database, or ask your hosting provider to. Datasources are created in the CF Administrator. Until you have one, you cannot interact with databases!

<CFQUERY name="InsertExchangeRateData" datasource="myDataSource">
INSERT INTO exchangerates (country, rate, currency)
VALUES ('England', 1, 'GBP')
</CFQUERY>
<CFQUERY name="InsertExchangeRateData" datasource="myDataSource">
INSERT INTO exchangerates (country, rate, currency)
VALUES ('America', 1.36, 'USD')
</CFQUERY>
<CFQUERY name="InsertExchangeRateData" datasource="myDataSource">
INSERT INTO exchangerates (country, rate, currency)
VALUES ('Europe', 0.80, 'EUR')
</CFQUERY>

I get really confused as it is not clear where I should put this code. Do I make a cfm document and put it in there? Also, how do I create a datasource to work with Access?

I realise this is alot of annoying newbie behaviour but any help would be great, thanks!!! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum