beautypg.com

Define a recordset in a cfc, Use a cfc recordset as a source of dynamic content – Adobe Dreamweaver CS3 User Manual

Page 677

background image

DREAMWEAVER CS3

User Guide

670

For more information, see the ColdFusion documentation from within Dreamweaver (Help > Using ColdFusion).

6

Save the page (File > Save).

Define a recordset in a CFC

Dreamweaver can help you define a recordset (also known as a ColdFusion query) in a ColdFusion component
(CFC). By defining a recordset in a CFC, you don’t need to define the recordset on each page that uses it. You define
the recordset once in the CFC and use the CFC on different pages.

Note: This feature is available only if you have access to a computer running ColdFusion MX 7 or later. For more infor-
mation, see “Enable the ColdFusion enhancements” on page 674.

1

Create or open an existing CFC file in Dreamweaver.

2

In the Bindings panel (Window > Bindings), click the Plus (+) button and select Recordset (Query) from the

pop-up menu.

The Recordset dialog box appears. You can work in either the simple or the advanced Recordset dialog boxes.

3

To use an existing function in the CFC, select the function from the Function pop-up menu and skip to step 5.

The recordset is defined in the function.

4

To define a new function in the CFC, click the New Function button, enter a name for the function in the dialog

box that appears, and then click OK.

The name must contain only alphanumeric characters and underscores (_).

5

To define a recordset for the function, complete the Recordset dialog box options.

The new function is inserted into the CFC that defines the recordset.

See also

“Create or delete a CFC in Dreamweaver” on page 666

Use a CFC recordset as a source of dynamic content

You can use a ColdFusion component (CFC) as a source of dynamic content for your pages if the component
contains a function defining a recordset.

Note: This feature is available only if you have access to a computer running ColdFusion MX 7 or later. For more infor-
mation, see Enable the ColdFusion enhancements.

1

Open a ColdFusion page in Dreamweaver.

2

In the Bindings panel (Window > Bindings), click the Plus (+) button and select Recordset (Query) from the

pop-up menu.

The Recordset dialog box appears. You can work in either the simple or the advanced Recordset dialog box.

3

Click the CFC Query button.

4

Complete the CFC query dialog box, click OK, and then click OK again to add the CFC recordset to the list of

available content sources in the Bindings panel.

5

Use the Bindings panel to bind the recordset to various page elements.

For more information, see “Adding dynamic content to pages” on page 564.

September 4, 2007