ACC: How to Use a Secured Database in Word Mail Merge
ID: Q120810
|
The information in this article applies to:
-
Microsoft Access versions 2.0, 7.0, 97
-
Microsoft Word for Windows, versions 6.0, 7.0, 97
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
- Start Word and create a new document. Save the document as
TESTMRG.DOC.
- On the Tools menu, click Mail Merge. Click the Create button,
select Form Letters, and then click the Active Window button.
- Click the Get Data button, select Open Data Source, and then in the
Files Of Type box, select MS Access Databases (*.mdb).
- 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.
- Select MS Access Databases Via DDE, and then click OK.
- 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.
- Select the Mailing List table, click OK, and then click the
Edit Main Document button.
- Click the Insert Merge Field button on the Mail Merge toolbar. Add
several fields to the document.
- Click the Merge To New Document button on the Mail Merge toolbar
and verify that the merge is successful.
- 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
- Follow steps 1-4 in section 2 above.
- Select "MS Access <x.x> Databases via ODBC," and then click OK.
- 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.
- Select the Mailing List table, click OK, and then click the Edit Main
Document button.
- Click the Insert Merge Field button on the Mail Merge toolbar. Add
several fields to the document.
- 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.
REFERENCES
For information about creating a WordBasic macro to set the connect
string, please see the following article in the Microsoft Knowledge Base:
Q110334 WordBasic Examples Using ODBC: MailMergeOpenDataSource
For information about securing a database in Microsoft Access version
2.0, please see the following article in the Microsoft Knowledge Base:
Q132143 ACC2: Overview of How to Secure a Microsoft Access Database
For information about securing a database in Microsoft Access 97, search
the Help Index for "How do I secure a database."
Keywords : kbinterop
Version : 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
|