Web
Server Manual | Frames
Format
Overview of Cold Fusion | top

Access Database Management Overview | top
In order to use your Access database, you'll need to upload the Access file (.mdb) to your website cgi-bin folder, using your preferred FTP program. The /cgi-bin folder is located in wwwroot.Before you start, contact the server administrator to request a database be set up as a Cold Fusion datasource. The name should be unique to your account or domain. Something like nt000xx_domainname will work well without potential conflicts with other accounts on the same server.
Access the database in your Cold Fusion template with the <cfquery></cfquery> tag set
Example:
<CFQUERY NAME="query_name" DATASOURCE="nt000xx_domainname">
Insert your standard SQL statements here; SELECT, UPDATE, INSERT, DELETE
</CFQUERY>There are several optional parameters available for the CFQUERY tag. See your CF documentation for full details.
Displaying your QUERY data | top
If you have performed a cfquery with a SELECT statement, all of the data is available to your application. To access any Cold Fusion variables including results of a query, you will use the variable name enclosed within ## which is also enclosed within a <cfoutput></cfoutput> tag set.Example:
The query below would select a list of customers including their first name, last name, and email address from a database table called customers.
<CFQUERY NAME="name_list" DATASOURCE="nt000xx_domainname">
SELECT first_name, last_name, email
FROM customers
ORDER BY last_name
</CFQUERY>Now this data is available for display on your page in whatever way you choose. For this example, we will show it in a table.
<table width="300" cellspacing="2" cellpadding="2" border="1"> <tr> <th>First Name</th> <th>Last Name</th> <th>Email</th> </tr> <cfoutput query="name_list"> <tr> <td>#first_name#</td> <td>#last_name#</td> <td><a href="mailto:#email#">#email#</a></td> </tr> </cfoutput> </table>The above code would produce the output seen below. The list of names placed in table rows would be as many as are retrieved by the original query.
Cold Fusion recommended links | top
Cold Fusion recommended books | top