Microsoft KB Archive/120810

= ACC: How to Use a Secured Database in Word Mail Merge =

Article ID: 120810

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition
 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q120810





SUMMARY
Advanced: Requires expert coding, interoperability, and multiuser skills.

To access a secured Microsoft Access database using ODBC or DDE, you must log on using a valid Microsoft Access account. Microsoft Word for Windows will not open a merge document if you do not have Read Data permission on the table or query that is specified as the data source.

This article describes how to use a secured Microsoft Access database in a Microsoft Word for Windows mail merge.



MORE INFORMATION
This article describes how to complete the following tasks to set up an example of using a secured Microsoft Access database in a Word mail merge:


 * Creating a merge document in Word, using DDE to access the secured database as the data source.
 * Creating a merge document in Word, using ODBC to access the secured database as the data source.

Detailed instructions for these tasks are listed below.

Create a Merge Document in Word, Using DDE to Access the Secured Database

 * 1) Start Word and create a new document. Save the document as TESTMRG.DOC.
 * 2) On the Tools menu, click Mail Merge. Click the Create button, select Form Letters, and then click the Active Window button.
 * 3) Click the Get Data button, select Open Data Source, and then in the Files Of Type box, select MS Access Databases (*.mdb).
 * 4) Locate and select the secured database you created. In Word version 6.0, select the Confirm Conversions check box, and then click OK. In Word 7.0 and 97, select the Select Method check box, and then click Open.
 * 5) Select MS Access Databases Via DDE, and then click OK.
 * 6) When you are prompted, enter the user name and password for the account that has permissions, and then click OK.

NOTE: If you are using Microsoft Access 97 and have set a Database password for the database you are trying to open, you will have to enter that password when prompted.
 * 1) Select the Mailing List table, click OK, and then click the Edit Main Document button.
 * 2) Click the Insert Merge Field button on the Mail Merge toolbar. Add several fields to the document.
 * 3) Click the Merge To New Document button on the Mail Merge toolbar and verify that the merge is successful.
 * 4) After saving, try to reopen the document. When you are prompted, enter user information for an account that should not have permissions. Verify that the document fails to open.

Create a Merge Document in Word, Using ODBC to Access the Secured Database

 * 1) Follow steps 1-4 in section 2 above.
 * 2) Select "MS Access  Databases via ODBC," and then click OK.
 * 3) When you receive a message stating that the default login is invalid, click OK, and then enter the user name and password for the account that has permissions. Click OK.
 * 4) Select the Mailing List table, click OK, and then click the Edit Main Document button.
 * 5) Click the Insert Merge Field button on the Mail Merge toolbar. Add several fields to the document.
 * 6) Click the Merge To New Document button on the Mail Merge toolbar and verify that the merge is successful.

You can create new ODBC data sources using the ODBC icon in Control Panel. Creating a new ODBC data source with the 32-bit Microsoft Access driver lets you specify the default database, user name, and workgroup file (SYSTEM.MDW).

NOTE: If you are using a version of Microsoft Access earlier than 7.0, you will only be allowed to specify the default database and user name.

To avoid being prompted for a user name and password each time you open the document, add this information to the connect string programmatically.

