Breadcrumb {international nav OR 10x10 spacer gif}
Build the results page

After the user selects or enters a search parameter (in this case, a U.S. state), the application must retrieve records from the database. This work is done by the results page.

To save time, we've provided you with a blank results page that contains a pre-designed layout. If you haven't downloaded the results.cfm and banner2.gif files that are provided with this tutorial, return to the contents page and do so now. Once you've downloaded the files, place the results.cfm file in the main directory of The Wildlife Project site (the same directory where the index.cfm page resides). Place the banner2.gif file in the images folder of The Wildlife Project site.

Once the banner2.gif file is in the images folder of your Dreamweaver site, open the results.cfm page, place the insertion point immediately below the banner graphic, and insert the Fireworks navigation bar that you created in Wildlife Project 10: Building a Fireworks MX Navigation Bar (Part 1), and Wildlife Project 11: Building a Fireworks MX Navigation Bar (Part 2). When you insert the navigation bar, follow the procedures you learned in Wildlife Project 13: Assembling and editing your Studio MX assets.

When you're finished, your page should look like this:

Now you're ready to build the results page.

1 In Dreamweaver, make sure the results.cfm page is open in the Document window.
2 Create a new recordset by opening the Bindings panel (Window > Bindings), clicking the plus (+) button, and selecting Recordset from the pop-up menu.
Note: You may need to specify your RDS login information before you can create a recordset. For more information, see Wildlife Project 7: Connecting to a database.
3 Make sure the simple Recordset dialog box appears.

If the advanced dialog box appears instead, switch to the simple dialog box by clicking the Simple button.
4 In the Name text box, enter rs_wildlife.
5 From the Data Source pop-up menu, select wildlife.
Note: You must complete Wildlife Project 7: Connecting to a database before you can see the connection.
6 From the Table pop-up menu, select CONTACT_INFORMATION.
7 Next to Columns, select the All option.
8 From the first pop-up menu in the Filter area, select the STATE column.
9 From the pop-up menu beside the first menu, select the equal sign (it should be the default).
10 From the third pop-up menu, select URL Parameter.
11 In the fourth box, enter US_STATE. This is the name of the form object that accepts the search parameter on the search page (index.cfm).
You can get the name by switching to the search page, clicking the form object (the pop-up menu) on the form to select it, and checking the object's name in the Property inspector. The URL parameter in the filter area and the name of the form object must be exactly the same.
The completed filter should look like this:

When the user selects a state (value) from the US_STATE pop-up menu on the search page and clicks the Search button, the server compares that value to all of the values in the STATE column of the database. The server then creates a recordset by filtering out all values that do not precisely match the selected value. For example, if a user selects Pennsylvania from the pop-up menu and clicks the Search button, the results page will return a recordset containing only those records that match the PA value in the STATE column of the database table.
12 From the Sort pop-up menus, select CITY from the first pop-up menu, and Ascending from the second pop-up menu. This will sort the results of your search query, and list them alphabetically by city on the results page.
Your finished Recordset dialog box should look like this:

13 (Optional) Click Test, enter a test value known to be in the database (for example PA), and click OK to connect to the database and create an instance of the recordset.
The test value simulates the value that would otherwise have been returned from the search page. Click OK to close the recordset.
14 Click OK to close the Recordset dialog box.
The new recordset appears in the Bindings panel.

Next you'll display the data from the recordset you just created.

To Table of Contents Back to Previous document Forward to next document