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 dont 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 Enabling the ColdFusion enhancements.
To define a recordset in a ColdFusion component:
- Create or open an existing CFC file in Dreamweaver.
For more information, see Visually creating a component in Dreamweaver.
- 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.
- 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.
The recordset is defined in the function.
- 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.
The name can only contain letters, numbers, and the underscore character (_). You cannot use special characters or spaces.
- Use the Recordset dialog box to define a recordset for the function.
For more information, click the Help button in the dialog box.
After youre done, Dreamweaver inserts a new function in your CFC defining the recordset.
To edit the CFC recordset visually, double-click it in the Bindings panel.
- Using a CFC recordset as a source of dynamic content