Defining a recordset in a ColdFusion component

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.

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:

  1. Create or open an existing CFC file in Dreamweaver.

    For more information, see Visually creating a component 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. 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.

  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.

    The name can only contain letters, numbers, and the underscore character (_). You 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.

    To edit the CFC recordset visually, double-click it in the Bindings panel.

Related topics

  • Using a CFC recordset as a source of dynamic content

Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly
Building ColdFusion Applications Rapidly
Building ASP.NET Applications Rapidly
Building ASP and JSP Applications Rapidly