


The following procedure describes how to access your COBOL data from Microsoft Word 2000, the word processing component of Microsoft Office 2000. Another procedure has been provided for users of Word 97 (the version that came with Microsoft Office 97). If you have a different version of Word, follow whichever procedure you desire. Even though your steps may be slightly different, the concepts will be largely the same.
1. Start Word 2000.
2. Open the document into which you want to insert data.
3. Select Mail Merge from the Tools menu. To locate the Mail Merge option, point to the expansion arrows on the bottom of the Tools menu.
The Mail Merge Helper dialog box appears.
4. Under "Main Document," click Create and select Form Letters.
5. To insert data into the active window in Word, select Active Window. You are then returned to the Mail Merge Helper dialog box.
6. Under "Data Source," click Get Data, and select Open Data Source.
7. Click MS Query in the Open Data Source dialog box. (If you do not have an MS Query button, you may need to install MS Query on your machine.)
This starts MS Query, and opens the Choose Data Source dialog box. If you want to use MS Query's "Query Wizard" to create your SQL query, leave the "Use Query Wizard" check box selected. Refer to MS Query's online documentation for instructions on using the Query Wizard.
For simplicity, clear the Query Wizard.
8. Select the DSN that corresponds to the data source you want to access and click OK. (Refer to section 3.1 "Data Source Names" for instructions on creating DSNs.) If you want to use the sample DSN that comes with AcuODBC, select AcuODBC Datasource.
9. Select the table or tables that you want to add (for example, "clients"), and then click Add. Close the box when you're done.
For each table you selected, a list box is displayed on the MS Query screen. This box lists all of the columns in the associated table.
10. Double-click each column that you want to read into your Word document, and that column appears on the screen, as in the following example. If you want to add all columns, double-click the "*" at the top of the list box. If you prefer, you can populate the table by clicking the SQL button and entering and executing an SQL query. See Step 12 for the SQL syntax that does the same thing you did in this step.
11. To enter an SQL statement, click SQL.
12. In the SQL dialog box, type the SQL command you want to execute. Click OK when you're done. (For a description of the SQL commands supported by AcuODBC, refer to section 5.3, "SQL Syntax Supported by AcuODBC".)
14. Close the active dialog box in Word. Notice that new mail merge buttons are added to the toolbar.
15. Place the cursor in your document where you want to insert the data. Click Insert Merge Field to see a drop-down list of table columns. These are the columns that you selected in MS Query.
16. Select the merge field of interest. The control characters for this field are placed in your document.
17. To display the exact data in this field, click <<ABC>>.
18. Finish your document as you normally would. Whenever you want to insert a COBOL data field, click Insert Merge Field once again and select the appropriate field. To move to the next, previous, first, or last record in the table, click the corresponding button on the toolbar.
For more instructions on using Word's mail merge feature, refer to your Microsoft documentation.