Thanks
(edited by: madcat at 11:02 pm (utc) on May 29, 2002)
A plain txt editor (notepad) will do the trick. If your going to be working with the files and/or creating more .cfm pages it might be worth buying dreamweaver mx. You can get a trial version (released today) at the macromedia site.
In the past ColdFusion Studio was where most CF programmers worked, but with the new MX range CF studio has been combined with DreamWeaver.
I rearranged what I had to say a bit above. I'm also interested in knowing how the database works in relation to the .cfm files and the server. Do I simply upload the .cfm files as I would .html files. I'm gonna have to pick up this routine pretty fast;) Any help in explaining the process would be greatly appreciated.
M
From memory however there is an option to GET, PUT, and SYNCHRONIZE files, although this might be a dreamweaver thing.
To move files from the site to your computer use the GET command to move the files.
**BEWARE** Like I said I haven't used it in a few years, read the instructions CuteFTP give you and make sure you are coping the files across and not moving.
The other option is to select the site as your local site and your computer as the remote site and synchronise them.
<<Do I simply upload the .cfm files as I would .html files
Yes, thats all that is required.
Database connections can be either via ODBC or direct depending on the database and server set up.
What platform are you on?
To access the cars database from this site you need to create a Datasource Name. To do this open ColdFusion Administrator and get into the ODBC Datasources. Here you can choose from 17 different database connections (.mbd, .dbf, .xls, .txt, .csv etc).
The cars database was written in MSSQL2000, so I select the MS SQL SERVER Driver as the connection type and 'car' as the datasource name. Once added, specify the name of both the server, in my case (local), and name of the database.
**note the datasource name does not need to be the same as the database name. <simple> car can be the DSN, while cars is the actual DB name.</simple>
Once the database is listed and has been verified in ColdFusion Administrator you will be able to call it from within your *.cfm pages.
When a *.cfm page parsed by the browser, the web server recognises the extension (Apache uses a module, not sure about IIS) and passes the page to the CF Server. The server scans the page looking for <cf > </cf > tags as well as #hash# instructions. The server processes these commands sequentially. Once finished the page is sent back to the webserver and returned to the browser as HTML.
From what I understand (not having coded in PHP or ASP) compared to other scripting languages, ColdFusion reduces the amount of coding required to open a connection to the database.
To create a connection using ColdFusion:
<cfquery name="car_type" datasource="car">
SELECT *
FROM toyota
ORDER BY car_id
</cfquery>
To then display the results, output the results further down the page:
<cfoutput query="car_type">
#model#, #year#, #DollarFormat(price)# <br>
</cfoutput>
Which will produce:
Hilux, 1978, $4000
Camry, 1999, $16000
.......for however many records there are.
Any HTML code which is included within the <cfoutput></cfoutput> tags will be repeated for x number records.
If you are going to be using a lot of queries on the one database here's a tip. In the Application.cfm page add
<cfset DSN = "car">
car being the datasource name for the cars database. Now when opening a connection you include
<cfquery name="car_type" datasource="#dsn#">
Now if for some reason the administrator changes the name of your datasource you need only update one source.
This might be more then you were after, I hope I didn't confuse you.
I'm dealing with IIS and MSSQL : So I will need ColdFusion Administrator, what is that and how can I get it? So the db you labeled as 'car' is sitting with the other files on the site, correct? I am a neophyte - have patience;)
thanks
M
Your web server is IIS and the database is MSSQL. Do you have control over the server, or are you with a hosting company?
ColdFusion Administrator is the Web interface for Administrating the ColdFusion Server. If you are hosted by another company I am very doubtful they will grant you access to this, where as is you have control of the server it is usuall found at http*://localhost/cfide/administrator/index.cfm
The actual database can be sitting ANYWHERE, as long as the coldfusion server is able to access it. Once you have listed the database in the odbc datasources Coldfusion use the datasource name to locate the server as the mappings are already in place.
**note, it's not a good idea to put the database in the same folder as your pages. I imagine it could then be downloaded if someone entered http*://mysite/cars/cars.mbd
Do you have control over the server, or are you with a hosting company?
The site will be hosted on another server but we are suppose to be given control over any administration. We are trying to move to a dedicated Dell server totally in our control : We just have to wait and see- really long story...
Ok. How far off am I? So the ColdFusion Administrator is the GUI where I connect my database name to a datasource which allows my .cfm files to access the CF server. Rudimentary huh?
The ColdFusion Administrator is the GUI where I connect my database to a datasource name which allows my .cfm files to access the database using CF server.
I've been through the setup of a new server running SQL Server and ColdFusion 5 so I should be able to answer most of the questions you have. I was using Apache so you may need IIS guru's for some problems.
As long as you have administrative access it's fairly simple to set up, it's when you rely on others to make the changes delays can occur.
So the ColdFusion Administrator is the GUI where I connect my database name to a datasource which allows my .cfm files to access the CF server.
Correct, it is where you set up the database name and point it to a file. CF Administrator comes with the CF Server software. If you have access to root (whoops, sorry, Admin) then you should be able to access CF Admin. But CF Admin is only good for setting up the connection to the db, verity searches and other CF Server settings. You'll need something to edit the db and I have no idea as to what to use on an MS SQL db. I don't suppose PHPMyAdmin would work...
It would be best to avoid an ODBC connection if possible. A direct connection is much faster and more reliable than an ODBC connection.
In your case Madcat, *sigh*, you're dealing with MS. I believe you may be able to talk to the db directly but I'm not sure.
So the first questions that need to be answered are how will you connect to the db (ODBC or direct), the name of the db, and what tool are you going to use to build/edit your tables.
If this is an existing site are there already dbs in place? If so, you'll need to know their names and table structure (table name, column names, data types, length of fields, primary key, indexed or not, joins etc...
If the tables don't exist, then now's your chance to map out a table structure that fits your needs for the project and provides for growth.
I'm hitting the sack now but I'll check in tomorrow to see if I can help.