Wrox Programmer Forums
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 3rd, 2005, 12:27 PM
Registered User
Join Date: Jan 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Set security warning off

Every time I open my access database I get the following message:

"Security Warning:
This file may not be safe if it contains code that was intended to harm your computer..."

I know that it's got a few macros and that if I set the macro security to Low I will get rid of these message. However, my database is going to run in more machines so I want to remove that message in them all. I've tried Docmd.setwarnings False in a function called by the Autoexec macro but the message still pops up!!!

Any idea how to get rid of it in VBA without modifying any Access settings.

Thanks very much in advance.

Old March 4th, 2005, 09:36 AM
Friend of Wrox
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post

It sounds like you're using Access 2003. This is a new feature much like the features that were added to Office Word and Excel years ago.

There are several ways to disable the message. However, you cannot disable the message from the code in your database since the message appears BEFORE your code is executed... after all, if your code could execute, there's no point in displaying the message because if it was malicious code the attack would have already occurred.

The recommended method is to digitally sign your database. You'll need a "digital certificate" to do this. Chapter 20 in our book "Access 2003 VBA Programmers Reference" discusses this. (Access help describes this as well.)

Another option is to launch your DB using a VBScript. This is also in the book. In brief, the VBScript creates an Access object, sets the security level to low, then opens the database. The security level only applies to that instance of Access -- when your users close your database and exit Access, the security level for Access returns to whatever was set using Tools | Macro | Security.

Of course, as you mention, setting security to low (on every machine that opens your database) is an option. For obvious reasons, this is not recommended.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Access Security & Role Based Security robzyc C# 6 April 11th, 2008 02:31 AM
Access 2007 security warning tang_moor Access 1 February 8th, 2007 08:23 AM
System.Security.SecurityException: Security error coolcatjk Pro VB.NET 2002/2003 4 March 2nd, 2006 06:00 PM
Security Warning ggiibboo Access 0 January 3rd, 2006 03:11 AM
Warning Messages Varg_88 Beginning VB 6 1 June 8th, 2004 12:10 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.