ACC97: ASP Query Cannot Be Used with the LIKE Predicate (162977)
The information in this article applies to:
- Microsoft Access 97
- Microsoft Internet Information Server 3.0
- Microsoft Internet Information Server 4.0
This article was previously published under Q162977 Advanced: Requires expert coding, interoperability, and multiuser skills.
SYMPTOMS
When you browse to an Active Server Pages (ASP) file that was exported from
Microsoft Access 97, the Web browser either returns no records or you
receive the following error message:
Expression cannot be used with the LIKE predicate in query expression.
CAUSE
Because ASP files use ActiveX Data Objects (ADO) to 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. ASP files use the percent sign (%) as a wildcard character
in SQL statements whereas Microsoft Access uses the asterisk (*).
In addition, when Microsoft Access exports a query that contains a
parameter concatenated with a wildcard, the SQL statement that is generated
does not contain the correct sequence and number of delimiters around the
wildcard.
RESOLUTION
Edit the SQL statements in the ASP files so that they use the percent sign
(%) for wildcards.
If parameter queries with wildcards are exported, edit the SQL statements
in the ASP file so that they use the percent sign (%) as the wildcard along
with the correct sequence and number of delimiters around the wildcard.
REFERENCES
For more information about exporting ASP files, search the Help Index for
"ASP files," or ask the Microsoft Access 97 Office Assistant. In addition,
please refer to your ASP online documentation.
Modification Type: | Minor | Last Reviewed: | 1/26/2005 |
---|
Keywords: | kbbug kberrmsg kbinterop KB162977 |
---|
|