Sunset at Oak Island, North Carolina

Spider Web Woman Designs

How to search for a value between two other values using the FrontPage Database Wizard

SUMMARY

The Microsoft FrontPage® 2003 Database Results Wizard can be tweaked to allow your site visitors to search for a number value between two other numbers. This article describes the steps to implement the search into your web site.

MORE INFORMATION

This article assumes that you have already imported your database into your web, and that FrontPage has created the fpdb folder, put the database in that folder, and created the global.asa file and the database connection. Please review How to create a FrontPage Database Connection for more information. For this tutorial, we will be using a database called realestate.mdb that you can download from this site in a zip file format. We are going to name the Database connection "realdb1". We are going to use the "properties" table.

To search the database for a value between two other values, follow these steps:

Launch FrontPage and open your web site.

Create a new page and save it as search.asp.

Open search.asp In Design View, select the Insert menu, point to Database, and select Results.

In step 1 of the wizard, select Use an existing database connection (realdb1).

Click Next.

In step 2 of the wizard, select your record source (properties).

Click Next.

In step 3 of the wizard, select More Options.

Under More Options, select Criteria.

Under Criteria, select Add.

Under Add Criteria, select propPrice in the Field Name dropdown list. Select Not Less Than in the Comparision dropdown list. Enter startPrice in the Value field. Leave the Use this search form field checkbox checked. Click OK to go back to the Criteria dialog box.

In the Criteria dialog box, click Add again.

Under Add Criteria, select propPrice in the Field Name dropdown list. Select Not Greater Than in the Comparision dropdown list. Enter endPrice in the Value field. Leave the Use this search form field checkbox checked. Click OK to go back to the Criteria dialog box.

Click OK to close the Criteria dialog box.

Click OK to close the More Options dialog box and go back to the Database Results Wizard dialog box.

In the Database Results Wizard dialog box, click Next to go to the next screen.

Choose your formatting options and click Next.

On the last screen, choose your display options and leave the Add search form checkbox checked. Click Finish.

Save the page and Preview in Browser.

When the page is loaded in your browser, you will get a Database Results Wizard Error – this is because you have not yet entered any search criteria. To make sure your page is working, enter some values in the startPrice and endPrice fields and submit the query. To prevent this error, you need to prevent the DBRW from returning results before searching.

 



Email UsWe're on Google+LinkedIn ProfileFollow us on TwitterLike Us on Facebook!