WD98: Word Can't Parse Your Query Options into Valid SQL String

Last reviewed: February 17, 1998
Article ID: Q177029
The information in this article applies to:
  • Microsoft Word 98 Macintosh Edition

SYMPTOMS

When you query for certain records during a mail merge, you may receive the following error message:

   Word could not parse your query options into a valid SQL String.

This problem will occur in either of the following cases:
  • Case 1: You use quotation marks or an apostrophe in the Query Options Compare To box.

    -or-

  • Case 2: You query a data source, and a record in that data record contains an apostrophe.

CAUSE

This error message will occur when either of the following conditions are met.

Case 1

This problem will occur if you are connected to an external data source, such as one created in Microsoft Excel 98 Macintosh Edition, and you use quotation marks or an apostrophe in the Query Options box to create a Compare To entry containing a quotation mark or an apostrophe.

Case 2

The data source that you are querying contains an apostrophe in its data.

WORKAROUND

Case 1

Do not include quotation marks or an apostrophe when you set up your query options. To do this, follow these steps:

  1. From the mail merge main document, click Mail Merge on the Tools menu, and then click Query Options.

  2. under Compare To, select the Field and Comparison settings, and enter a value without quotations marks or an apostrophe.

  3. Click OK.

Case 2

There is no known workaround for this Case.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

When you perform the mail merge, the results may not show quotation marks from your data, depending on how you are connecting to the data source. If you are connecting through Dynamic Data Exchange (DDE), you will not receive quotation marks in the results of the merge. However, if you connect by converting the data source (for example, from a Microsoft Excel 97 for Windows or Microsoft Excel 98 Macintosh Edition worksheet), you will receive quotation marks in the results of the merge.

To open a Microsoft Excel data source by DDE, follow these steps:

  1. On the Tools menu, click Mail Merge.

  2. Click Get Data, and then click Open Data Source.

  3. Find the Excel worksheet you want to draw data from, select it, and then click Open.

To open a Microsoft Excel data source by converting a Microsoft Excel 97 for Windows or Microsoft Excel 98 Macintosh Edition worksheet, follow these steps:

  1. On the Tools menu, click Mail Merge.

  2. Click Get Data, and then click Open Data Source.

  3. Under List Files of Type, select Microsoft Excel 97-98 Worksheet, find the Excel worksheet you want to draw data from, select it, and then click Open.

  4. On the Open Worksheet dialog box, select the appropriate settings and then click OK.

For additional information about this situation in earlier versions of Word, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q125414
   TITLE     : WD: Errors When Querying on Data with Straight
               Quote/Apostrophe


Additional query words: errmsg odbc sql query filter sort
apostrophe apostrophes curly quote curly quotes double quotation marks
double quote double quotes quoted quotes single quotation mark single
quotation marks single quote smart quotation marks smart quotes
Keywords : kbmerge macword98 kbfaq
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbbug kbinfo
Solution Type : kbfix kbworkaround


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: February 17, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.