ACC97: IDC Parameter Queries Cannot Use LIKE and WildcardsID: Q163893
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you browse to an IDC file that was exported from Microsoft Access 97,
the Web browser returns the following error:
Expression cannot be used with the LIKE predicate in query expression.
Because IDC files communicate with ODBC drivers in order to query the back-end data, the SQL statements they contain have different character requirements than typical Microsoft Access SQL statements. IDC files use the percent sign (%) as a wildcard character whereas Microsoft Access uses the asterisk (*). When Microsoft Access exports a query that contains a parameter concatenated with an asterisk, the SQL statement that is generated contains a parameter concatenated with a percent sign. However, the IDC SQL statement does not need the concatenation operator (&). Instead, it simply needs a series of percent signs (%) to be placed after the parameter.
Edit the SQL statement in the IDC file so that it doesn't use a concatenation operator, but instead uses the appropriate sequence of percent signs (%).
NOTE: This section contains information about editing IDC files, and
assumes that you are familiar with editing IDC files. Microsoft Access
Product Support professionals do not support customization of any HTML, HTX,
IDC, or ASP files.
The following example demonstrates how to change the SQL Statement in an
IDC file so that it contains the appropriate sequence of parameter and
wildcard characters.
Query: FindName
-----------------------------------
Type: Select Query
Field: CompanyName
Table: Customers
Criteria: Like [EnterName] & "*"
Parameter Data Type
----------------------------
[EnterName] Text
SQLStatement:SELECT Customers.CompanyName
+FROM Customers
+WHERE (((Customers.CompanyName) Like '%[EnterName]%%%'));
For more information about exporting IDC files, search the Help Index for
"IDC files," and then choose "Export a datasheet to dynamic HTML format,"
or ask the Microsoft Access 97 Office Assistant. In addition, please refer
to the IIS Help Index.
For more information about using wildcards in IDC files, please see the
following article in the Microsoft Knowledge Base:
Q147361 How to Use Wildcards in IDC Files
Additional query words: pra
Keywords : kbinterop OtpOthr QryParm IntpWeb
Version : 97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 17, 1999