Set access rights for Network Service to the directory, which holds the database file.
Enter the properties-page of the directory:

Open Properties Page
If it doesn’t already exist, add NETWORK SERVICE at the Security tab:

Add NETWORK SERVICE
Grant the right to modify for NETWORK SERVICE:

Grant rights for NETWORK SERVICE