File Access Denied with FoxPro Data Attached to Template

ID: Q122755

The information in this article applies to:

SUMMARY

After you open a mail merge main document based on a template that has been attached to a FoxPro database, you receive the following error message if you attempt to open your FoxPro database:

   File Access Denied

CAUSE

This behavior occurs because the database is set to Exclusive use. By design, when you create a Word document, you open the template in the background. If the template is attached to a data source, that data source is also open in the background. Therefore, if the database is set to be opened exclusively, and if it is already open in Word, you are denied access to it if you attempt to open it in FoxPro.

WORKAROUNDS

Method 1: Set the FoxPro database to Shared file use. By default, FoxPro

          opens the database for Exclusive use.

Method 2: Modify the Word template and remove the attachment to the Fox Pro
          data source.

Method 3: Create a main document based on the Normal template or another
          template. Then attach your data source.

Method 4: Record an AutoNew macro for the mail merge template that attaches
          the data source to your new main document.

KBCategory: KBSubcategory: kbmerge kbtemplate Additional reference words: 6.0 6.0a 6.0c winword merge main word6 document template datasource datafile attach attached access denied fox pro foxpro database data source data file
Keywords          : kbinterop kbtemplate kbmerge 
Version           : 6.0 6.0a 6.0c
Platform          : WINDOWS

Last Reviewed: February 6, 1998