Trust Locations in Access

How to prevent the following warning propping up for users every time they open your access application:


When you open the packaged application, you receive the following message:
A potential security concern has been identified.

Warning: It is not possible to determine that this content came from a 
trustworthy source. You should leave this content disabled unless the 
content provides critical functionality and you trust its source.

File path: <path>

This file might contain unsafe content that could harm your computer. 
Do you want to open this file or cancel the operation?

You can add folders to trusted locations from Office Button | Access Options | Trust Center | Trust Center Settings…| Trusted Locations

The entries will be stored in the registry under:

Access 2007

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations]

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Location(n)]

Access 2010

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations]

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\Location(n)]

Path: C:\PathtoDB\

AllowSubFolders: 1


If packaging up an access solution, then place the registry keys in the Package solution wizard.

Package Access Runtime Application with ODBC

I build a little application in access 2007 which connected to a SQL Server backend via a SQL authenticated Login.

I packaged the solution up as an installer, but didn’t want to manually go round pushing out ODBC connection separate to the install process. I wanted to be able to install the ODBC as part of the main installer, and then be able to remove the ODBC connection when the app was uninstalled.

The error in question:


The Access package solution wizard is useful for inserting registry keys into a machine as part of an install which would resolve the above error.

To enter an ODBC connection in the registry, i added the following keys (Enterprise Director is the name of my ODBC connection)

Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: Driver
Value: C:\Windows\system32\SQLSRV32.dll

Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: Server
Value: ServerName

Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: Database
Value: DatabaseName

LastUser is the SQL authenticated login to access the database
Root: Current User
Key: Software\ODBC\ODBC.INI\Enterprise Director
Name: LastUser
Value: CMEntDir


The overall effect of having these keys is that the ODBC is installed automatically without any additional action.

When opening the App, i know get the following prompt:


and the registry key is installed: