FP98: How to Search Using LIKE In SQL Statement For IDC or ASP

This article was previously published under Q194677
This article has been archived. It is offered "as is" and will no longer be updated.

For a Microsoft FrontPage 2000 version of this article, see 205231.
For a Microsoft FrontPage 98 version of this article, see 190621.
Summary
This article describes how to search a database using the LIKE parameter ina Structured Query Language (SQL) statement in either the Internet DatabaseConnector (IDC) Wizard or the Database Region Wizard of FrontPage.

This article assumes you have a basic knowledge of how to query a databaseusing Active Server Pages (ASP), Internet Database Connector (IDC) orHypertext Markup Language Extension (HTX) technologies in FrontPage.

For additional information about database connectivity with ASP or IDC/HTX,please see the following articles in the Microsoft Knowledge Base:
180405 FP98: Sample ASP Wizard Available for Download

175770 FP98: How to Post Information to a Database Using ASP

174407 FP98: How to Create IDC/HTX Files in FrontPage 98

161155 FP97: How to Make a Web Page Display Data from a Database
More information
When used in a search, the LIKE parameter generates a result set based on aminimum amount of information typed into the form field of a HyperTextMarkup Language (HTML) form. For example, if you type "mic" (without thequotation marks) in the form field, the results may include Microsoft,microphone, microwave, and so forth.

To use the LIKE parameter in a SQL statement in FrontPage, start the IDCwizard or the Database Region Wizard, and use the following syntax in theSQL statement
   SELECT * FROM <Table Name> WHERE <Database Field> LIKE '%%%<HTML   Field>%%%'				
where <Table Name> is the name of a table in the database, <DatabaseField> is a field in that table, and <HTML Field> is the name of an HTMLform field on an HTML document (usually a text box).

The extra percentage signs around the HTML form field name act as wildcards so that the LIKE string can match multiple records. For example, ifyou entered this SQL code
   SELECT * FROM Employees WHERE Email Like '%%%Email%%%'				
And type volcano in the form field, allrecords that contain volcano.com in the email field are returned.

NOTE: This example works with the Volcano.mdb file that is included withthe ASP sample Web. For additional information please see the followingarticle in the Microsoft Knowledge Base:
180405 FP98: Sample ASP Wizard Available for Download
If you use this query and the form field is blank when you submit the form,all records in the database will be returned. However, you can require thata value be entered before the form is submitted by using form fieldvalidation.
98 SQL ASP IDC Database LIKE
Properties

Article ID: 194677 - Last Review: 10/26/2013 15:36:00 - Revision: 2.0

  • Microsoft FrontPage 98 Standard Edition
  • kbnosurvey kbarchive kbinfo KB194677
Feedback