Microsoft KB Archive/111278

{|
 * width="100%"|

Overview: How to Use ODBC with Word 6.0 for Windows

 * }

Q111278

6.00 6.00a WINDOWS

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 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:

Tools Mail Merge, Get Data

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

 Choose Mail Merge from the Tools menu. Choose the Get Data button. Select the Confirm Conversions box. Select or provide Word with the correct drive, directory, and filename of your database file. Choose the OK button. Choose the ODBC option in the Confirm Data Source box (you should see a DDE and ODBC option), and choose the OK button twice.

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.

DATABASE Field

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

 From the Insert menu, choose Field. In the Categories box, select the Mail Merge.</li> In the Field Names box, select Database.</li> Choose the Options button to insert any DATABASE field options.</li></ol>

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}" 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:

"Q132131 INF: ODBC Database Drivers 2.0 Supported Platforms"