Microsoft KB Archive/922685

From BetaArchive Wiki
Knowledge Base


How to create a database results page that is based on a value in a drop-down list in FrontPage 2003

Article ID: 922685

Article Last Modified on 8/7/2006



APPLIES TO

  • Microsoft Office FrontPage 2003




INTRODUCTION

This article describes how to create a database results page that is based on a value in a drop-down list in Microsoft Office FrontPage 2003.

Note After you create a database results page, you can sort this page to fit your needs.

MORE INFORMATION

To create a database results page that is based on a value in a drop-down list, follow these steps:

  1. Open a Web site in FrontPage 2003.
  2. Create a new Web page, and then name it Test.asp.
  3. On the Insert menu, point to Form, click Form to add a form on the Web page, and then delete the Reset button.
  4. On the Insert menu, point to Database, and then click Results.
  5. Click ASP, click Use a sample database connection (Northwind), and then click Next.
  6. Click Custom query, and then click Edit.
  7. Type the following code in the SQL Statement pane, and then click OK:

    Select Distinct City from Employees
  8. Click Next.
  9. Click Edit List, remove any existing fields except for the City field, and then click OK.
  10. Click Next.
  11. Click Dropdown List -one record per item in the Choose formatting options for the records returned by the query list, and then click Next.
  12. Click Finish.

If you want to sort the database results page, follow these steps.

  1. Right-click the form, and then click Form Properties.
  2. Click Send to other, and then click Options.
  3. In the Action box, type Test.asp, and then click OK two times.
  4. On the Insert menu, point to Database, and then click Results.
  5. Click ASP, click Use a sample database connection (Northwind), and then click Next.
  6. Click Custom query, and then click Edit.
  7. Type the following code in the SQL Statement pane:

    Select * from Employees where City = '::City::' Order By ::SortColumn:: ASC

    Note For more information about supported SQL statements, click the following article numbers to view the articles in the Microsoft Knowledge Base:

    907307 You receive a "Database Results Wizard Error" error message when you browse an ASP page after you upgrade to FrontPage 2003 or to FrontPage 2002 S907307

    871267 You receive an "Unable to find operator in query string" error message when you use the ORDER BY parameter in a custom SQL query in FrontPage 2003

  8. Click Verify Query, and then click OK two times.
  9. Click Next, and then click More Options.
  10. Click Defaults.
  11. Select the SortColumn field, and then click Edit.
  12. In the Value box, type City, and then click OK three times.
  13. Click Next two times, and then click Finish.
  14. In the database results area, select the field that you want to use to sort the results.
  15. On the Insert menu, click Hyperlink.
  16. In the Address box, type Test.asp, and then click Parameters.
  17. Click Add.
  18. Click Add, type City in the Name box, type <%=request ("City")%> in the Value box, and then click OK.
  19. Click Add, type Sortcolumn in the Name box, type Firstname%20DESC in the Value box, and then click OK.

    Note The ASC or DESC sort order can be defined in the SQL Statement field that is mentioned in step 7.
  20. Click OK two times.


Keywords: kbcode kbhowto KB922685