Define a recordset

Now you'll create a recordset to select the data you want to display. A recordset is a set of information extracted from a database by a database query. (In ASP.NET, a recordset is known as a DataSet.) A database query is a way to request data from a database using specified search criteria, usually in a language called SQL. You then use the information extracted as a source of content for your dynamic pages.

Dreamweaver MX 2004 provides an easy-to-use interface for creating simple SQL queries (you don't need to know SQL to create a recordset in Dreamweaver).

You'll create a recordset that selects all of the values from the COMMENTS table in the Trio database.

Note: Before you can complete this procedure, you must set up a connection to the database. For more information, see Before you begin.

  1. In Dreamweaver, in the comments-view document, place the insertion point where you want to display the data.
  2. Open the Recordset dialog box or (for ASP.NET) the DataSet dialog box by doing one of the following:
  3. In the Name text box, enter rs_Comment.
  4. In the Data Source pop-up menu (ColdFusion) or Connection pop-up menu (other server page types), select connTrio.

    The Recordset or DataSet dialog box updates with data from the database.



  5. If a user name and password are associated with the data source or connection, enter them. If you didn't provide a user name or password when you set up the data source, leave these boxes blank.
  6. In the Table pop-up menu, leave COMMENTS selected.
  7. In Columns, make sure All is selected, to select all columns of the table.
  8. Leave the Filter pop-up menu set to None, to select all rows of the table.
  9. In the first Sort pop-up menu, select LAST_NAME, and in the second pop-up menu, select Ascending.

    This specifies that the retrieved records will be listed in alphabetical order by customer last name.



  10. Click Test to test the recordset or DataSet.



    The records from the database that match your recordset or DataSet selection criteria are displayed in the Test SQL Statement window. In this case, you selected all the data in the table.

  11. Click OK to close the Test SQL Statement window.
  12. Click OK to close the Recordset or DataSet dialog box, and create a recordset or DataSet.

    The recordset appears in the Bindings panel. The Document window doesn't change.

    Tip: If you don't see all of the recordset fields in the Bindings panel, click the Plus (+) button (Windows) or expander arrow (Macintosh) next to Recordset (rs_Comment) to expand the recordset's structure.




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/dreamweaver/mx2004/getting_started_en/gs_08_d5.htm