How To Add an All Values Item to a Database Query by Using the FrontPage 2003 Database Results Wizard
Please Note:
FrontPage 2003 is no longer supported for Fpweb.net managed hosting clients. However, we continue to offer online help & support resources for Microsoft® FrontPage in our expansive Support Achive.
This article describes how to add an All Values item to a database query by using the Microsoft® Office FrontPage 2003 Database Results Wizard.
For a Microsoft® FrontPage 2002 version of this article, see 293169 .
For a Microsoft® FrontPage 2000 version of this article, see 244968 .
IN THIS TASK
SUMMARY
The Database Results Wizard uses Active Server Pages ASP) on a Web server that is running Microsoft® Internet Information Services (IIS) to search a database. This article describes how to create an All Values search item for querying a database. Because the process is slightly different if you want to search a text field or a numeric field, this article presents both techniques in separate examples.
Note– The following procedures are for use with a FrontPage Server Extensions-based Web server. The steps to perform these procedures with a Website based on Microsoft® Windows SharePoint Services (WSS) are beyond the scope of this article. Websites that are located on servers that are running on Windows SharePoint Services use a different set of features to display data.
For more information about Windows SharePoint Services, see the Microsoft® Windows SharePoint Services 2.0 Administrator’s Guide.
The following file is available for download from the Microsoft® Download Center: Download the SharepointTSAdmin package now.
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft® Knowledge Base:
119591 – How to Obtain Microsoft® Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft® used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
Add an Add Values Item to a Text Field Query
You can perform a search of all text fields in a database by using a single wildcard character (%). From FrontPage, you can add an All Values option to a drop-down list of query values. To add an All Values item to a text field query, follow these steps:
- Open a Web on a Web server that is running IIS and create a new page named Alltextvalues.asp.
-
On the Insert menu, point to Database, and then click Results.
Note– If the Database option is not available on the Insert menu, verify that the authoring computer is not behind a firewall or using an encrypted channel or VPNthat may interfere with the communication to the server. For more information about how to troubleshoot this problem, click Microsoft® FrontPage Help on the Help menu, type Troubleshoot database integration with ASP or ASP.NET in the Answer Wizard, and then click Search to view the topic.In the wizard, follow these steps:
- Click Use a sample database connection (Northwind), and then click Next.
- Click Record Source.
In the Record Source list, click Products, and then click Next. - Click More Options.
In the More Options dialog box, click Criteria. - In the Criteria dialog box, click Add.
- In the Add Criteria dialog box, make the following selections:
- In the Field Name list, click ProductName.
- In the Comparison list, click Contains.
- Click to select the Use this search form field check box.
- Click OK.
- Click OK two more times to return to step 3 in the Database Results Wizard.
- Click Next two times, and then click Finish.
- Select the text box that is next to ProductName, and then press DELETE.
-
Add a drop-down box with a list of search values. To do this, use either of the following methods.
Create a search list manually
- On the Insert menu, point to Form, and then click Drop-Down box.
- Double-click the drop-down box.
In the Name box, type ProductName. - Click Add. In the Add Choice dialog box, follow these steps:
- In the Choice box, type All Values.
- Click to select the Specify Value check box.
- In the Specify Value box, type %.
- Under Initial State, click Selected.
- Click OK.
- Repeat step c to add the following additional choices, values, and states to the drop-down list:
Choice Value Initial State ------------------------------------------------- Chai Chai Not Selected Chang Chang Not Selected Aniseed Syrup Aniseed Syrup Not Selected - Click OK to close the Drop-Down Box Properties dialog box.
Create a search list dynamically
- On the Insert menu, point to Database, and then click Results. In the wizard, follow these steps:
- Click Use a sample database connection (Northwind), and then click Next.
- Click Record Source.
In the Record Source list, click Products, and then click Next. - Click Edit List.
In the Displayed Fields list, select all fields except ProductName, and then click Remove. Click OK. - Click Next.
- In the Choose formatting options for the records returned by the query list, click Drop-down list – one record per item, and then click Next.
- Click Finish.
- Double-click the drop-down box.
In the Name box, type ProductName. - Click Add. In the Add Choice dialog box, follow these steps:
- In the Choice box, type All Values.
- Click to select the Specify Value check box.
- In the Specify Value box, type %.
- Under Initial State, click Selected.
- Click OK.
- In the Drop-Down Box Properties dialog box, click the All Values entry, and then click the Move Up button to move the selection to the top of the list.
- Click OK to close the Drop-Down Box Properties dialog box.
- Save the page as Alltextvalues.asp.
- Preview the page in a Web browser by using HTTP.
- In the ProductName list, click Chai, and then click Submit Query.
All the items in the database that contain Chai in the product name will appear. - To search for all the products, click All Values, and then click Submit Query.
All the product names in the database will appear.
Add an All Values Item to a Numeric Field Query
If you want to search all numeric fields in a database, you cannot use wildcard characters. However, you can use a logic operation to get the same results. To add an All Values item to a numeric field query, follow these steps:
- Open a Web on a Web server that is running IIS and create a new page that is named Allnumericvalues.asp.
- On the Insert menu, point to Database, and then click Results. In the wizard, follow these steps:
- Click Use a sample database connection (Northwind), and then click Next.
- Click Record Source.
In the Record Source list, click Products, and then click Next. - Click More Options.
In the More Options dialog box, click Criteria. - In the Criteria dialog box, click Add.
- In the Add Criteria dialog box, make the following selections:
- In the Field Name list, click ProductID.
- In the Comparison list, click Equals.
- Click to select the Use this search form field check box. (By default, this check box is selected.)
- Click OK.
- Click OK.
- In the More Options dialog box, click Defaults.
In the Input Parameters list, click ProductID, and then click Edit. - In the Value box, type 1 OR 1, and then click OK.
- Click OK two more times to return to step 3 of the Database Results Wizard.
- Click Next two times, and then click Finish.
- Select the form field text box next to ProductID, and then press DELETE.
- Add a drop down box with a list of search values. To do this, use either of the following methods.
Create a search list manually
- On the Insert menu, point to Form, and then click Drop-Down box.
- Double-click the drop-down box.
In the Name box, type ProductID. - Click Add. In the Add Choice dialog box, make the following selections:
- In the Choice box, type All Values.
- Click to select the Specify Value check box.
- In the Specify Value box, type 1 OR 1.
- In the Initial State section, click Selected.
- Click OK.
- Repeat step c to add the following additional choices, values, and states to the drop-down list:
Choice Specify Value Initial State ----------------------------------------------------- Chai 1 Not Selected Chang 2 Not Selected Aniseed Syrup 3 Not Selected - Click OK to close the Drop-Down Box Properties dialog box.
Create a search list dynamically
- On the Insert menu, point to Database, and then click Results. In the wizard, follow these steps:
- Click Use a sample database connection (Northwind), and then click Next.
- Click Record Source.
In the Record Source list, click Products, and then click Next. - Click Edit List.
In the Displayed Fields list, select all fields except ProductID and ProductName, and then click Remove. Click OK, and then click Next. - In the Choose formatting options for the records returned by the query list, click Drop-down list – one record per item.
In the Display values from this field list, click ProductName. In the Submit values from this field list, click ProductID, and then click Next. - Click Finish.
- Double-click the drop-down box. In the Name box, type ProductID.
- Click Add. In the Add Choice dialog box, follow these steps:
- In the Choice box, type All Values.
- Click to select the Specify Value check box.
- In the Specify Value box, type 1 OR 1.
- Under Initial State, click Selected.
- Click OK.
- In the Drop-Down Box Properties dialog box, select the All Values entry, and then click the Move Up button to move the selection to the top of the list.
- Click OK to close the Drop-Down Box Properties dialog box.
- Save the page as Allnumericvalues.asp.
- Preview the page in a Web browser.
- In the ProductID list, click Product One, and then click Submit Query.
All the items in the database that contain the number one in their Product ID will appear. - To search for all products, click All Values, and then click Submit Query.
All the product IDs in the database will appear.
REFERENCES
For more information about working with databases, click Microsoft® FrontPage Help on the Help menu, type databases in the Answer Wizard, and then click Search to view the topic.
The information in this article applies to:
- Microsoft® Office FrontPage 2003
Microsoft® Knowledge Base Article – 825453
Expert Managed hosting services from Fpweb.net will save you up to 60% on your IT needs.