Go Back   Access World Forums > Microsoft Access Reference > Code Repository

 
Reply
 
Thread Tools Rating: Thread Rating: 14 votes, 5.00 average. Display Modes
Old 11-08-2011, 04:31 AM   #1
Dairy Farmer
Newly Registered User
 
Join Date: Sep 2010
Location: S of E, E of GM
Posts: 244
Thanks: 1
Thanked 22 Times in 12 Posts
Dairy Farmer is on a distinguished road
Trusted Location

Set the app path as a trusted location in Package Solution Wizard when making your installer.

Code:
Additional Registry Keys

Root = CU
Key = Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\MyApp
Name = Path
Value = c:MyApp

Root = CU
Key = Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\MyApp
Name = AllowSubfolders
Value = #00000001
Or via VBA

Code:
Function TrustedLocation()

    Dim RegKey As String
    Dim RegObj
    Dim Value As String
    Dim WTRTL As Object
    
    
    RegKey = "HKCU\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\MyApp\Path"
    Value = "c:\MyApp"

    Set WTRTL = CreateObject("WScript.Shell")
    WTRTL.RegWrite RegKey, Value, "REG_SZ"

End Function
Code:
Function TrustedLocationAllowSubFolders()

    Dim RegKey As String
    Dim RegObj
    Dim Value As String
    Dim TLAS As Object
    
    
    RegKey = "HKCU\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\MyApp\AllowSubFolders"
    Value = "1"

    Set TLAS = CreateObject("WScript.Shell")
    TLAS.RegWrite RegKey, Value, "REG_DWORD"

End Function

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Dairy Farmer; 11-08-2011 at 07:09 PM. Reason: Forgot half the code
Dairy Farmer is offline   Reply With Quote
The Following 3 Users Say Thank You to Dairy Farmer For This Useful Post:
AmyLambes (03-25-2012), JLCantara (08-19-2012), Rx_ (07-26-2012)
Old 12-27-2011, 10:16 AM   #2
mdlueck
Sr. Application Developer
 
Join Date: Jun 2011
Posts: 2,625
Thanks: 114
Thanked 295 Times in 283 Posts
mdlueck will become famous soon enough mdlueck will become famous soon enough
Re: Trusted Location

Useful information, Dairy Farmer. Thank you for posting where these settings come from under the covers.

Your first example had one typo. Corrected in red font here:

Code:
Additional Registry Keys

Root = CU
Key = Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\MyApp
Name = Path
Value = c:\MyApp

Root = CU
Key = Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\MyApp
Name = AllowSubfolders
Value = #00000001
__________________
--
Michael Lueck
Lueck Data Systems

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mdlueck is offline   Reply With Quote
The Following User Says Thank You to mdlueck For This Useful Post:
Rx_ (07-26-2012)
Old 05-11-2012, 02:26 AM   #3
ekayp
Newly Registered User
 
Join Date: Dec 2011
Location: London, UK
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
ekayp is on a distinguished road
Re: Trusted Location

Hi, I am assuming you add the above function(s) in a module within your application. How are they called if this is the case. What is a packaged solution?
I am having a problem with distributing a 2010 Access application to a user with a 2007 version and he seems to be encountering lot of problems trying to enable content as the application has quite a few Macros and some VBA code. Any ideas much appreciated.
Thanks in advance

ekayp is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Trusted Location Programatically speakers_86 General 3 09-06-2011 09:42 AM
Trusted Location KenHigg General 10 04-14-2011 12:34 PM
Allowing Trusted Location for 14 different users polaris General 2 01-27-2011 11:50 AM
Question reg. trusted location perlfan General 0 10-11-2010 01:45 AM
Access 2007 Trusted Location Sula Dunklin General 9 10-08-2008 02:49 AM




All times are GMT -8. The time now is 11:58 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World