You may receive a "The operating system cannot gain access to file" error message when you try to connect to a Microsoft Dynamics NAV database server


Symptoms


When you try to connect to a Microsoft Dynamics NAV database server, you may receive the following error message:

The operating system cannot gain access to file Database_File_Path. Please check that the file types and attributes are correct.
Note The placeholder Database_File_Path represents the file path of the Microsoft Dynamics NAV database.

Cause


This problem occurs because the release of Microsoft Dynamics NAV involved a change in security. The Microsoft Dynamics NAV server service is now created by using the NT Authority\Network Service logon account.

Resolution


To resolve this problem, you must give the NT Authority\Network Service logon account read and write access to the Database.fdb file. To do this, follow these steps:
  1. In Windows Explorer, locate the folder that contains the Database.fdb file.
  2. Right-click the Database.fdb file, and then click Properties.
  3. In the Properties dialog box, click the Security tab, and then click Add just under the Group or user names area.
  4. In the Select Users, Computers, or Groups dialog box, type Network Service, and then click OK.
    NETWORK SERVICE is added to the Group or user names area in the Properties dialog box.

  5. Click NETWORK SERVICE, and then click to select the following check boxes in the Allow column in the Permissions for NETWORK SERVICE area:
    • Read
    • Write
Alternatively, you can use the local system account.

More Information


Steps to reproduce the problem

  1. Install the Microsoft Dynamics NAV database server.
  2. Install the Microsoft Dynamics NAV client.
  3. Try to connect the client to the database server.
You may receive the error message that is mentioned in the "Symptoms" section.

References


For more information about changes in Microsoft Dynamics NAV, visit the following Microsoft Web site: