Creating an advanced recordset by writing SQL
The advanced Recordset dialog box allows you to write your own SQL statements, or use the graphical Database Items tree to create a SQL statement
If you are writing SQL statements for ASP.NET document types, refer to Creating SQL queries using the Database Items tree for rules specific to ASP.NET.
If you want to create a simple recordset without manually writing SQL, see Creating SQL queries using the Database Items tree.
To define a recordset writing SQL:
- In the Document window, open the page that will use the recordset.
- Select Windows > Bindings to display the Bindings panel.
- In the Bindings panel, click the Plus (+) button and select Recordset (Query) from the pop-up menu.
The advanced Recordset dialog box appears. If you are developing a ColdFusion or ASP.NET site, the Recordset dialog box is slightly different from the example shown below. (If the simple Recordset dialog appears instead, switch to the advanced Recordset dialog box by clicking the Advanced button.)
- Complete the dialog box.
For instructions on completing the Recordset dialog box, see the section appropriate to your document type:
- Setting the advanced Recordset dialog box.
- Setting the advanced Recordset dialog box (ASP.NET)"
- Setting the advanced Recordset dialog box options (ColdFusion).
- Click the Test button to execute the query and ensure that it retrieves the information you intended.
If you defined a filter that uses parameters input by users, the Test button displays the Test Value dialog box. Enter a value in the Test Value text box and click OK. If an instance of the recordset is successfully created, a table displaying the data from the recordset appears.
- Click OK to add the recordset to the list of available content sources in the Bindings panel.