To create a database results page that is based on a value in a drop-down list, follow these steps:
- Open a Web site in FrontPage 2003.
- Create a new Web page, and then name it Test.asp.
- On the Insert menu, point to Form, click Form to add a form on the Web page, and then delete the Reset button.
- On the Insert menu, point to Database, and then click Results.
- Click ASP, click Use a sample database connection (Northwind), and then click Next.
- Click Custom query, and then click Edit.
- Type the following code in the SQL Statement pane, and then click OK:
Select Distinct City from Employees
- Click Next.
- Click Edit List, remove any existing fields except for the City field, and then click OK.
- Click Next.
- Click Dropdown List -one record per item in the Choose formatting options for the records returned by the query list, and then click Next.
- Click Finish.
If you want to sort the database results page, follow these steps.
- Right-click the form, and then click Form Properties.
- Click Send to other, and then click Options.
- In the Action box, type Test.asp, and then click OK two times.
- On the Insert menu, point to Database, and then click Results.
- Click ASP, click Use a sample database connection (Northwind), and then click Next.
- Click Custom query, and then click Edit.
- 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
- Click Verify Query, and then click OK two times.
- Click Next, and then click More Options.
- Click Defaults.
- Select the SortColumn field, and then click Edit.
- In the Value box, type City, and then click OK three times.
- Click Next two times, and then click Finish.
- In the database results area, select the field that you want to use to sort the
results.
- On the Insert menu, click Hyperlink.
- In the Address box, type Test.asp, and then click Parameters.
- Click Add.
- Click Add, type City in the Name box, type <%=request ("City")%> in the Value box, and then click OK.
- 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. - Click OK two times.