Building Queries - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Building queries

As discussed earlier in this chapter, you build queries using the
Note: This and many subsequent procedures use the CompanyInfo data source that connects to the
company.mdb database. This data source is installed by default. For information on adding or
configuring a data source, see Configuring and Administering ColdFusion MX.
To query the table:
Create a ColdFusion page with the following content:
1
<html>
<head>
<title>Employee List</title>
</head>
<body>
<h1>Employee List</h1>
<cfquery name="EmpList" datasource="CompanyInfo">
SELECT FirstName, LastName, Salary, Contract
FROM Employee
</cfquery>
</body>
</html>
Save the page as emplist.cfm in the myapps directory under your web_root directory. For
2
example, the default path on a Windows computer would be:
C:\CFusionMX\wwwroot\myapps\
Enter the following URL in your web browser:
3
http://127.0.0.1/myapps/emplist.cfm
Only the header appears, as the following figure shows:
View the source in the browser:
4
430
Chapter 20: Accessing and Retrieving Data
tag and SQL.
cfquery

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion mx

Table of Contents