Macromedia dreamweaver 8-using dreamweaver User Manual
890
Chapter 40: Building ColdFusion Applications Rapidly
Defining a recordset in a ColdFusion component
Dreamweaver can help you in 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.
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.
This feature is only available if you have access to a computer running ColdFusion MX 7 or
later. For more information, see
later. For more information, see
.
To define a recordset in a ColdFusion component:
1.
Create or open an existing CFC file in Dreamweaver.
For more information, see
.
2.
In the Bindings panel (Window > Bindings), click the Plus (+) button and select Recordset
(Query) from the pop-up menu.
(Query) from the pop-up menu.
The Recordset dialog box appears. You can work in either the simple or the advanced
Recordset dialog boxes.
Recordset dialog boxes.
3.
If you want to use an existing function in the CFC, select the function from the Function
pop-up menu and skip to step 6.
pop-up menu and skip to step 6.
The recordset is defined in the function.
4.
If want 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.
for the function in the dialog box that appears, and then click OK.
The name can only contain letters, numbers, and the underscore character (_). You
cannot use special characters or spaces.
cannot use special characters or spaces.
5.
Use the Recordset dialog box to define a recordset for the function.
For more information, click the Help button in the dialog box.
After you’re done, Dreamweaver inserts a new function in your CFC defining the
recordset.
recordset.
To edit the CFC recordset visually, double-click it in the Bindings panel.
Using a CFC recordset as a source of dynamic
content
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. For more information on creating
this kind of CFC, see
the component contains a function defining a recordset. For more information on creating
this kind of CFC, see