Building a Query for the Home Page

In this lesson, you will build a query that retrieves information from the Employees database to display on your Home page.

 

  1. From the toolbar, place a Recordset object on the Home page. This will define the set of results the query will return.

 

The Recordset Object Properties Palette will appear.

 

           

 

 

  1. Type EmployeeList in the Name field. This will be the name of your Recordset.
     

 

Next, you will define your Recordset by selecting the table and fields that will be queried.
 

 

  1. Double-click to open the SQL Wizard.
     

  2. Select the Employees table from the "Table Name" drop-down list.

    You will see the Employees datafields listed in the Fields section.

 

 

  1. Highlight all datafields listed. If a datafield(s) is not highlighted, the field will not be queried and no data will be returned.
     

  2. Click OK to close the SQL Wizard.

 

 

Now, you can determine how your Recordset results will be returned.

 

  1. Type LastName in the OrderBy field. This will use the LastName datafield to order the records when displayed.
     

  2. Choose Ascending in the Sort field to display the employee information, after ordered by LastName, in ascending (A-->Z) order.
     

 

 

Next, you will add objects that will iterate through your recordset and display the query results.