Home arrow ColdFusion arrow Page 3 - Databases and Dreamweaver MX 2004, concluded

Databases and Dreamweaver MX 2004, concluded

This article, the second of two parts, looks at the different database applications available for use with ColdFusion. It is excerpted from chapter two of the book ColdFusion Web Development with Dreamweaver MX 2004, written by Jen and Peter de Haan et al. (Apress; ISBN: 1590592379).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 10
January 12, 2006
  1. · Databases and Dreamweaver MX 2004, concluded
  2. · Using Dreamweaver MX 2004 to Create Queries
  3. · Using Dreamweaver MX 2004ís Advanced Recordset Interface
  4. · Writing a SELECT Query in Advanced Mode
  5. · Filtering by Multiple Parameters

print this article

Databases and Dreamweaver MX 2004, concluded - Using Dreamweaver MX 2004ís Advanced Recordset Interface
(Page 3 of 5 )

The advanced mode in Dreamweaver allows you to customize SQL syntax and write complex queries that can select data from more than one table. To switch to advanced mode, simply click on the Advanced button in the top right of the Recordset dialog box. The advanced layout of the Recordset dialog box is shown in Figure 2-12.

Figure 2-12.  The Advanced Recordset dialog box

At the bottom of the window is the Database Items tree, which shows any existing tables, views, and stored procedures for the selected data source.

We cover views and stored procedures in Chapter 6, but for now just expand the Tables tree by clicking on its plus symbol. You should see three database tables. You can expand these as well, as shown in Figure 2-13, to see the columns for each of these tables.

Figure 2-13. You can expand the Database Items tree to view the structure of the database.

If you followed the previous example and clicked Advanced, you would see the following SQL code, which Dreamweaver generated when you selected your options in the simple Recordset dialog, as shown in Figure 2-14.

Figure 2-14.  Dreamweaver automatically generates this SQL code.

The SQL statements shownSELECT the Dept_ID and Dept_Name from the Departmt table for all records where the location equals Cambridge, and then sort any matching records by department name in ascending order.

TIP   It is important to note that SQL uses single quotation marks around strings. If you accidentally use double quotation marks, SQL will throw an error. Numbers and Booleans do not need single quotation marks around them.

Notice that in theORDER BYstatement, department name in ascending order is specified. By default, SQL orders all columns in ascending order, so you could shorten this line toORDER BYDept_Name and produce exactly the same results. You can verify this by clicking on Test. To reverse the sort order, add theDESC(descending) keyword after the column name.

Letís create a few queries in advanced mode before moving on to writing SQL from scratch.

blog comments powered by Disqus

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials