ACC2000: Data Access Page Based on Query That Uses Jet Wildcard Characters Returns No Results (302411)
The information in this article applies to:
This article was previously published under Q302411 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
When you create a data access page that is based on a query whose criteria use Microsoft Jet wildcard characters, the page does not return any records.
CAUSE
This behavior occurs because Jet-specific wildcard characters are not valid for data access pages, and data access pages therefore do not return records. Data access pages use the Microsoft Jet OLEDB provider, which recognizes only ANSI 92 wildcard characters. The query functions properly if you run the query from Access, but a data access page that is based on the same query returns no records.
Because data access pages use ActiveX Data Objects (ADO) to communicate with ODBC drivers to query the back-end data, the SQL statements that the data access pages contain have different character requirements from those of typical Access SQL statements. For example, data access pages use the percent sign (%) as a wildcard character in SQL statements, whereas Access uses the asterisk (*).
RESOLUTION
To resolve this issue, alter the syntax of the query to use the ANSI 92 wildcard character equivalents. For example, if the query uses a Like "*" syntax, alter the syntax to use Like "%", save the query, and then run the query again. The query returns no records unless you actually have literal percent signs in your data, but when you run the data access page that is based on the query, the data access page displays all records.
Modification Type: | Minor | Last Reviewed: | 7/14/2004 |
---|
Keywords: | kbprb KB302411 |
---|
|