You receive a "Word was not able to open the data source" error message when you try to insert a selection of database records into a Word 2003 document (830870)



The information in this article applies to:

  • Microsoft Office Word 2003

SYMPTOMS

When you insert a database into a Microsoft Office Word 2003 document by using a query, and you choose to insert the database records as a field, you may receive the following error message:
Word was not able to open the data source.
After you click OK, you receive the following error message:
Word could not replace the selection with the specified database.
In the Word document where you wanted to insert the database records as a field, Word inserts the following text instead:
Error! Cannot open data source.

CAUSE

This problem may occur if you choose to insert the database records as a field, instead of as a table. The field code that is generated has an error in the syntax of the WHERE statement.

WORKAROUND

To work around this problem, use one of the following methods.

Modify the field code syntax

To modify the field code, follow these steps.

Note These steps assume that you are using an existing field code entry in your document.
  1. Right-click the field code, and then click Toggle Field Codes.
  2. Locate the WHERE statement.

    Typically the WHERE statement of the field code is at the end of the field code text.
  3. Put the insertion point before the word WHERE.
  4. Insert a blank space before the world WHERE.
  5. Right-click the field code, and then click Update Field.
The field code will update correctly.

Insert database records as a table

You can insert records that are returned from a query as a table and not as a field. To do so, follow these steps:
  1. On the Database toolbar, click Insert Database.
  2. Click Get Data.
  3. Click Browse, and then locate your data source.

    Click Open.
  4. Click Query Options, and then create your query.

    Click OK.
  5. Click Insert Data.
  6. If the Insert data as field check box is selected, click to clear the Insert data as field check box.
  7. Select the range of records or click All, and then click OK.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MajorLast Reviewed:3/23/2006
Keywords:kberrmsg kbDatabase kbQuery kbprb KB830870 kbAudEndUser