Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Trust Center Default Settings

Status
Not open for further replies.

Bill6868

Technical User
Mar 20, 2007
96
US
I have been programming Access databases for about 15 years and I’ve gotten pretty good at it, thanks to the Tek-Tips Forum. Recently I’ve been laid off and I am out interviewing for a new job – I’m work as an Administrative Assistant. Many companies try to use Excel as a database and in the interview I point out the pitfalls of doing this. So I bring my laptop and give a brief presentation on the virtues of Access in managing data. To entice them into looking at a good example of an Access application I leave them with a nicely developed recipe database which I save on a flash drive. Well over 2,000 recipes, lots of pictures, reports, tons of VBA coded event procedures and lots of macros.

In many cases my interviewer has never even opened Access before and I know that if the default settings in the Trust Center are not changed to enable macros, the database will not operate. So I leave them with a Word document (with print screen directions embedded) that describe how to change the security settings.

I have two questions:

1. Why is Access defaulted to disable all macros from the get-go? After all, macros and VBA coded event procedures are what turns your database into a user friendly application.

2. I need them to select the radio button that states “enable all macros (not recommended; potentially dangerous code can run)”. These are some very menacing words, indeed. Any suggestions on how I can handle this with my prospective employer or client?

Good grief!
 
After all, macros and VBA coded event procedures are what turns your database into a user friendly application.
Becasue Polyanna, macros and VBA code can also turn your database into a very simple very hostile application. With a few lines a code I could send you a database when you open it would delete everything on your hard drive. Not everyone has such good intentions as yourself.
 
Well said![colorface] Protection is Number One! [cannon]

The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Thanks for your input MajP and The Missinglinq - What I am most concerned with is the second part of my question (need advice):

I need them (my client) to select the radio button that states “enable all macros (not recommended; potentially dangerous code can run)”. These are some very menacing words, indeed. Any suggestions on how I can handle this with my prospective employer or client?
 
I typically use a vbscript to set security and copy the latest version of the application to a user. Note, this is Access 2007. The RegEdPath would need to be modified for other versions.

Code:
'===================
' File: SetAccessSecurity.vbs
'===================
   Const SystemFolder= 1
   Dim fso  'to be used for file related code
   Dim SysFolder
   Dim SysFolderPath
   dim strUserLogin 
   Dim RegEdPath
   Dim strAppFolder
   Set fso = wscript.CreateObject("Scripting.FileSystemObject")
   Set SysFolder =fso.GetSpecialFolder(SystemFolder)
   SysFolderPath= SysFolder.Path

   'initialize the script shell object
   Set WshShell = WScript.CreateObject("WScript.Shell")
   strUserLogin = WshShell.ExpandEnvironmentStrings("%USERNAME%") 
   strAppFolder = "C:\users\" & strUserLogin & "\MyApp"
   if not fso.FolderExists(strAppFolder) Then
      fso.CreateFolder "C:\users\" & strUserLogin & "\MyApp"
   End If

   RegEdPath = "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\"

   WshShell.RegWrite  RegEdPath  , "MyApp"

   'Write the values into the registry

   WshShell.RegWrite  RegEdPath & "MyApp\Path" , "C:\Users\" & strUserLogin & "\MyApp\"

   WshShell.RegWrite  RegEdPath & "MyApp\AllowSubfolders" , 1, "REG_DWORD"
   wscript.Echo strUserLogin & " Security Setup Complete!"
   fso.CopyFile "H:\Applications\MyApp\MyApp_AP.accdb","C:\Users\" & strUserLogin & "\MyApp\", 1
   wshshell.Run "C:\Users\" & strUserLogin & "\MyApp\MyApp_Ap.accdb"
wscript.Quit

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top