ACC1x: Parameter Queries, Wildcards, and SQL Server

Last reviewed: April 2, 1997
Article ID: Q92682
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SUMMARY

The asterisk (*) and the question mark (?) wildcard characters are not valid in SQL Server parameter queries and thus are interpreted by SQL Server as text. Unless these characters are present in the field restricted by the parameter, the query will return an empty set.

Instead of using the asterisk (*) and the question mark (?) wildcard characters in parameter queries, use the percent sign (%) and the underscore (_), the SQL Server wildcard characters.

MORE INFORMATION

SQL Server uses the percent sign (%) and the underscore (_), the ANSI standard wildcard characters, whereas Microsoft Access uses the asterisk (*) and the question mark (?) wildcard characters. When executing a parameter query, Microsoft Access does not translate the wildcard equivalents; the string you type in the Query Parameters dialog box is passed verbatim to SQL Server. Microsoft Access translates only strings that are part of the QBE grid.

REFERENCES

For more information, search for "parameter query" using the Microsoft Access Help menu.


Keywords : kbusage QryParm
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.