Hi Beth,
It is certainly possible that I didn't fully understand you question,
although I question your motive in suggesting that I would respond to your
post without actually reading it first.
My answer was directed specifically to your comment:
The line of code supplied by MS does not work.
in reference to the AutomationSecurity property. The code samples I
included in my response were specifically geared towards overcoming the
macro security prompt on your clients computers. In your comentary you did
not give any specifics on exactly how you were tyring to use the
AutomationSecurity property or describe in what way the code "does not
work."
Obviously, the desired way to prevent the macro security warning is to
digitally sign your database. In cases where you do not want to (or can't)
sign your database, one mechanisim to "bypass" the warning for those
clients who feel that Macro Security is important is to launch your
applciation using Automation rather than by opening it directly in Access
or by pointing a shortcut directly to the .mdb file.
When implemented on a client computer, it would look like this:
1. Your database file(s) on the client computer.
2. A script similar to the example I gave you that opens your database file
using the AutomationSecurity property.
3. A shortcut pointing to the script file.
When the client clicks on the shortcut, it launches the script, which in
turn creates an automation instance of Access and sets the security to Low
before opening your database. Setting the UserControl property give your
client the ability to interact with the database as if it was launch
normally rather than using Automation. You don't have to restart Access
when you do this and the setting only affects the specific instance of
Access that is launched by the shortcut. You could replace the script with
some other stub launcher, for example you could write a small VB app that
launches databases using this mechanisim.
If you write deployment packages for your applications, you would need to
modify your deployments so that the shortcut points to the launcher
application rather than your database file.
Another alternative to bypass the warning would be to sign the database
with a SelfCert created using the cetificate creation tool that is included
with Office 2003. While these certificates are not usually trustable on a
client computer, you can export the Public Key of this type of a signature
and then have your client install the Public Key on thier computer, which
then allows them to trust the certificate, thus eliminating the warning.
The primary risk of the first method (script workaround) is that there is
nothing to prevent your database from being modified by a macro virus in a
way that it could be used to harm your clients computer. Remember, Macro
Security is not about protecting your code, it's about protecting your
clients computer. Macro Viruses are typcially designed to move from one
file to another for a period of time, and then do something on a specific
day. By signing a file, you make it possible to determine if the signed
objects have been modifed, and thus make it possible to not run the
modified code that is potentially harmfull.
The primary risk of the second method (SelfCert workaround) is that there
is no chain of authority to validate the certificate. While installing the
Public Key allows your client to "trust" the signature, there is nothing to
prevent some other person from creating a SelfCert using your name and
sending it to your client. The value of a Certificaiton Authority is to
validate that you are you, so when your client sees your signature that is
authenticated by some third party CA, they can be more confident that it is
actually from you.
Digital signing is nothing new, and it certainly isn't unique to Microsoft
or Office. Many companies digitally sign thier code in this same way. This
is just a new thing in Access 2003 and an important step in making
computers more trustworthy for your clients.
--
Regards,
Mike Wachal
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.