Overview: How to Use ODBC with Word 6.0 for Windows

Last reviewed: February 5, 1998
Article ID: Q111278
6.00 6.00a WINDOWS
 

The information in this article applies to:
  • Microsoft Word for Windows, version 6.0, 6.0a

SUMMARY

This article discusses ways you can use Open Database Connectivity (ODBC) in Word for Windows.

Word uses ODBC to retrieve information from single-tier, file-based, relational and nonrelational databases for mail merge and database operations. ODBC frees Word from having to convert, insert, or link a database in a Word document. With ODBC, Word can open and retrieve requested database data from a database file for use in a mail merge operation while maintaining the database file's original file format and structure.

Word includes ODBC drivers that can read Microsoft Access 1.0 and 1.1 for Windows; dBASE III, III+, and IV; and Paradox 3.5 for MS-DOS database files. Word can also read files saved from Microsoft FoxPro 2.0, 2.5, and 2.5a for MS-DOS and Microsoft FoxPro 2.5 and 2.5a for Windows, as these versions of FoxPro save in supported dBASE formats.

Note: You cannot use ODBC to open files via File Open or save files via File Save or File Save As.

MORE INFORMATION

Word uses ODBC in the following ways:

  1. Tools Mail Merge, Get Data

    To mail merge a relational database with a Word form letter, envelope, catalog, or mailing label:

    a. Choose Mail Merge from the Tools menu. b. Choose the Get Data button. c. Select the Confirm Conversions box. d. Select or provide Word with the correct drive, directory, and

          filename of your database file. Choose the OK button.
    
    e. Choose the ODBC option in the Confirm Data Source box (you should see

          a DDE and ODBC option), and choose the OK button twice.
    

  2. Insert Database

    When you choose Database from the Insert menu, Word will insert a database directly into a Word document in table format. The Insert Database feature provides query options for database record filtering, record sorting, and field selection as well as table formatting options.

  3. DATABASE Field

    When you access a database file with the DATABASE field, you can insert requested records into a Word document in table format:

    a. From the Insert menu, choose Field. b. In the Categories box, select the Mail Merge. c. In the Field Names box, select Database. d. Choose the Options button to insert any DATABASE field options.

    The following DATABASE field will insert all of the records from the EMPLOYEES table in the Microsoft Access database NWIND.MDB into a Word document in table format:

          {DATABASE \d "C:\\ACCESS\\NWIND.MDB" \c "DSN=MS Access Databases;
          DBQ=C:\\ACCESS\\NWIND.MDB;FIL=RedISAM" \s "SELECT * from EMPLOYEES"
          \* MERGEFORMAT}
    

  4. Microsoft Query

    "Microsoft Query" provides access to relational and two-tier databases. It allows you to view, edit, and organize database data and insert it into a Windows-based application. While Microsoft Query does not ship with Microsoft Word, Word will support Microsoft Query's use and be aware of its presence. If Microsoft Query has been installed, Word will ask if you would prefer to use Microsoft Query to access your database when choosing the Get Data button in a mail merge main document. Microsoft Query ships with Microsoft Excel version 5.0 for Windows.

For additional information about ODBC drivers, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q132131
   TITLE     : INF: ODBC Database Drivers 2.0 Supported Platforms

REFERENCES

"Microsoft Word User's Guide," version 6.0, pages 624-632, 677

"Microsoft Word Developer's Kit," 1994, Microsoft Press, pages 901-927


KBCategory:
KBSubcategory: kbmerge kbmerge
Additional reference words: 6.00 conv wm_query access word6
winword
Keywords : kbmerge kbprint
Version : 6.00 6.00a
Platform : WINDOWS
Issue type : kbhowto


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