Microsoft KB Archive/295234

= Compacting Access file resets NTFS permissions =

Article ID: 295234

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition
 * Microsoft Access 2000 Standard Edition
 * Microsoft Office Access 2003

-



This article was previously published under Q295234



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
After you compact a Microsoft Access database or an Access project that exists in a folder in an NTFS file system partition, you may notice that the custom NTFS permissions for the Access database file (.mdb) or for the Access project file (.adp) are reset unexpectedly.

Also, when you try to open the compacted Access database file (.mdb) or the Access project file (.adp), you may receive one of the following error messages:  

The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.

 

Microsoft Office Access can't find the database file '.'

Make sure you entered the correct path and filename.

 

Microsoft Office Access can't find the database file '.'

Make sure you entered the correct path and filename.





CAUSE
The compact process always compacts the source Access database file or the Access project file to a new file. The newly created file inherits NTFS permissions that are different from the source file. The inheritance of the NTFS permissions is based on the version of Access that is used to compact the file.

Access 2000
In Microsoft Access 2000, the newly created file automatically inherits the default NTFS permissions of the TEMP folder that corresponds to the currently logged-in user account.

To obtain the path of the TEMP folder that corresponds to the currently logged-in user account, type Echo %TEMP% at the command prompt.

Note By default, the path of the TEMP folder is C:\Documents and Settings\ \Local Settings\Temp where  is the name of the user account that is currently logged in.

Access 2002 or Office Access 2003
In Access 2002 or in Office Access 2003, the newly created file automatically inherits the default NTFS permissions of the parent folder of the Access database file or of the Access project file.



WORKAROUND
To work around the problem, use either of the following methods, depending on the version of Access that you are running:

Access 2000
You may assign appropriate permissions to the TEMP folders that correspond to all the user accounts of the computer.

Access 2002 or Office Access 2003
You may assign appropriate permissions to the parent folder of the Access database file or of the Access project file.

<div class="moreinformation_section">

Steps to reproduce the behavior
Note The following steps assume that you are running Access on a Microsoft Windows 2000-based computer or on a Microsoft Windows NT 4.0 Service Pack 6-based computer. The following steps assume also that you are familiar with creating NTFS partitions and with setting file-level permissions on files on an NTFS partition.
 * 1) Start Access.
 * 2) On the File menu, click New.
 * 3) In the New File task pane, click Blank Database.
 * 4) In the File New Database dialog box, locate a folder in an NTFS partition.
 * 5) Type a file name for the new database, and then click Create.
 * 6) Close the database, and then quit Access.
 * 7) In Windows Explorer, locate the folder where you created the database in step 5.
 * 8) Click the database, and then click Properties on the File menu.
 * 9) In the Properties dialog box, click the Security tab.
 * 10) Customize the permissions for a particular account, and then click OK.

For example, add a test user account, and then give Full Control permissions to the user account.
 * 1) Start Access, and then open the database that you created in step 5.
 * 2) On the Tools menu, point to Database Utilities, and then click Compact and Repair Database.
 * 3) Close the database, and then quit Access.
 * 4) In Windows Explorer, locate the folder where you created the database in step 5.
 * 5) Click the database file, and then click Properties on the File menu.
 * 6) In the Properties dialog box, click the Security tab.

Notice that the custom permissions that you set in step 10 have been reset.

Additional query words: acc2000 acc2002 acc2003 pra prb temporary

<div class="references_section">