WD2000: Errors When Using ODBC to Insert Microsoft Excel Worksheet (245652)



The information in this article applies to:

  • Microsoft Word 2000

This article was previously published under Q245652

SYMPTOMS

When you attempt to insert a Microsoft Excel worksheet into a Word document or when you attempt to attach a Microsoft Excel worksheet as a data document to a mail merge main document using the Excel Files via ODBC (*.xls) driver, one of the following error messages appears:

Case 1

Word was unable to open the data source.

Case 2

Open Database Connectivity Error: Syntax error in query. Incomplete query clause.

When you click the Details button, the following error message appears:

ODBC Error: [Microsoft][ODBC Excel Driver] Syntax error in query.
Incomplete query clause.
SQL State: S1000
Return Code: SQL_Error

CAUSE

You did not select a worksheet from the Select Table dialog box. (To locate this dialog box, select the Select Method check box in the Open Data Source dialog box, select the Excel Files via ODBC (*.xls) driver in the Confirm Data Source dialog box, and then click OK.)

WORKAROUND

Use the following procedure to insert a Microsoft Excel worksheet as a database in Word:

NOTE: Be sure that the Microsoft Excel ODBC driver is installed before you follow this next procedure. If the Microsoft Excel ODBC driver is not installed, re-run Setup and install the ODBC driver.
  1. On the View menu, point to Toolbars, and then click Database. The Database toolbar appears.
  2. Click the Insert Database button on the Database toolbar.
  3. Click the Get Data button.
  4. Select the Microsoft Excel workbook you want to open, select the Select Method check box, and then click Open.
  5. In the Confirm Data Source dialog box, under Open Data Source, select Excel Files via ODBC (*.xls), and then click OK.
  6. In the Select Table dialog box, click Options.
  7. In the Table Options dialog box, select the System Tables check box, and then click OK.
  8. In the Select Table dialog box, under Table, select the worksheet you want to insert, and then click OK.

    NOTE: Each sheet name is appended with a dollar sign ($) symbol, such as Sheet1$, Sheet2$, and so forth.
For additional information about using an Excel file as a data source in a Word mail merge, click the article number below to view the article in the Microsoft Knowledge Base:

213866 WD2000: Word Ignores First Record in Excel Data

212314 WD2000: How to Use Microsoft Excel Data Source for Mail Merge

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MajorLast Reviewed:12/6/2000
Keywords:kbbug kbinterop kbmerge KB245652