ACC2000: How to Use a Secured Database in Word Mail Merge

Article translations Article translations
Article ID: 208933 - View products that this article applies to.
This article was previously published under Q208933
This article has been archived. It is offered "as is" and will no longer be updated.
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access database (.mdb).

Expand all | Collapse all

On This Page

SUMMARY

This article describes how to use a secured Microsoft Access database in a Microsoft Word for Windows mail merge. This article assumes you have already created or have access to a secured Access database.

To access a secured Microsoft Access database using Open Database Connectivity (ODBC) or Dynamic Data Exchange (DDE), you must log on using a valid Microsoft Access account. Microsoft Word for Windows does 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.

MORE INFORMATION

You can create a merge document in Microsoft Word using either DDE or ODBC to access a secured database. Choose either of the following methods.

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

  1. Start Word, create a new document, and then save the document as TestMerge.doc.
  2. On the Tools menu, click Mail Merge.
  3. Click Create, click Form Letters, and then click Active Window.
  4. In the Mail Merge Helper, click Get Data, click Open Data Source, and then in the Files of type box, click MS Access Databases (*.mdb).
  5. Locate and select the secured database you created. Click to select the Select Method check box, and then click Open.
  6. Click MS Access Databases Via DDE, and then click OK.
  7. When prompted, type the user name and password for an account that has permissions, and then click OK.

    NOTE: If you have set a database password for the database that you are trying to open, you are also prompted to enter that password.
  8. From the list of tables in the secure database, select the any table that holds some data, click OK, and then click Edit Main Document.
  9. On the Mail Merge toolbar, click Insert Merge Field. Add several fields to the document.
  10. On the Mail Merge toolbar, click Merge To New Document, and then verify that the merge is successful.
  11. Save and close TestMerge.doc, and then try to reopen the document. When prompted, type the 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 through 5 in method 1.
  2. Click MS Access Databases via ODBC, and then click OK.
  3. If you receive a message stating that the default login is invalid, click OK, type the user name and password for the account that has permissions, and then click OK.
  4. From the list of tables in the secure database, click any table that holds some data, click OK, and then click Edit Main Document.
  5. On the Mail Merge toolbar, click Insert Merge Field, and then add several fields to the document.
  6. Click the Merge To New Document button on the Mail Merge toolbar, and then 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).

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

REFERENCES

For more information about creating a secured database, click Microsoft Access Help on the Help menu, type security in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about passing the user name and password in a connection string, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type odbcconnectstr property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Properties

Article ID: 208933 - Last Review: February 23, 2014 - Revision: 2.1
APPLIES TO
  • Microsoft Access 2000 Standard Edition
  • Microsoft Word 2000 Standard Edition
Keywords: 
kbnosurvey kbarchive kbhowto kbinterop KB208933

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com