Microsoft KB Archive/147361

= How to Use Wildcards In IDC Files =

Article ID: 147361

Article Last Modified on 6/23/2005

-

APPLIES TO


 * Microsoft Internet Information Server 1.0

-



This article was previously published under Q147361



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SUMMARY
When you use the Internet Database Connector (IDC) to query data from an ODBC database, you may need to use wild-cards in your SQL statements in the IDC file. The ODBC wildcard character is the percent (%) sign. After you set up an HTML query form, make sure that the percent (%) sign is entered in the query data.



WORKAROUND
If you do not want to instruct users to add the wildcard character to their queries, you can add the wildcard to the query data in the IDC file. In an IDC file, the single percent (%) sign is used to delimit the variables that are passed to it from the HTML form. Therefore, use two percent signs (%%) to insert the wild-card.

For example, given a form defined like this:

 Enter Name of product:   

In the Internet Database Connector file, GETPROD.IDC, you can append a wild- card to the user's input with the following sytax:

SQLStatement: + SELECT * from products + where prod_name like '%prdname%%%'

If the user types in the word "paper" as input to the form, the resulting query (after translation of the variables) is:

SELECT * from products where prod_name like 'paper%'

This selects any row from the database where the product name starts with the word "paper," followed by other characters.

Additional query words: prodiis wildcard

Keywords: kbnetwork KB147361

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.