Solved How to prevent "Enable Editing" warning?! (1 Viewer)

silversun

Registered User.
Local time
Yesterday, 21:43
Joined
Dec 28, 2012
Messages
204
Hi everybody.
I have a database that I want to send it to my friends so that they can use it. I realized when I attempt to open it for the first time on another computer this warning appears.
1587521066669.png

I know I can enable it easily by clicking on the button in the message bar but since my database opens with a pop-up form then it is not very simple for regular users who don't know much about this security warning. It makes them to think my program is contaminated or it is an untrustworthy file to open.
Is there any way of adding a VBA or simple button (for instance on pop-up form) that prevents this from happening?
Thank you in advance
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:43
Joined
Oct 29, 2018
Messages
21,454
Hi. You are correct! The "default" behavior for Access databases is to treat all "unknown" applications as "untrustworthy." That's where the Trusted Locations setting in Access comes in. If you set a Folder as a Trusted Location and then place your app in that folder, the warning won't show up because you have designated it as "trustworthy."

PS. I'd like to see a code solution too. But since it is "untrustworthy," the code (any code) is prevented from running. It's a catch-22 (chicken or egg) situation.
 

Micron

AWF VIP
Local time
Today, 00:43
Joined
Oct 20, 2018
Messages
3,478
Is there any way of adding a VBA or simple button (for instance on pop-up form) that prevents this from happening?
Pretty sure there is not. It would render the attempt to prevent malicious code from running a pointless exercise.
 

silversun

Registered User.
Local time
Yesterday, 21:43
Joined
Dec 28, 2012
Messages
204
Hi. You are correct! The "default" behavior for Access databases is to treat all "unknown" applications as "untrustworthy." That's where the Trusted Locations setting in Access comes in. If you set a Folder as a Trusted Location and then place your app in that folder, the warning won't show up because you have designated it as "trustworthy."

PS. I'd like to see a code solution too. But since it is "untrustworthy," the code (any code) is prevented from running. It's a catch-22 (chicken or egg) situation.
Thanks for fast respond. I will try it and get back to you.
 

Attachments

  • 1587522131793.png
    1587522131793.png
    19.4 KB · Views: 112

vba_php

Forum Troll
Local time
Yesterday, 23:43
Joined
Oct 6, 2019
Messages
2,880
That's where the Trusted Locations setting in Access comes in. If you set a Folder as a Trusted Location and then place your app in that folder, the warning won't show up because you have designated it as "trustworthy."
that's not the only solution. for instance, this:

 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:43
Joined
Oct 29, 2018
Messages
21,454

vba_php

Forum Troll
Local time
Yesterday, 23:43
Joined
Oct 6, 2019
Messages
2,880
Sorry, but I don't think that's the same thing. Actually, I don't know if Access has a "protected view,"
the steps in the article is what i was pointing to. I've been annoyed by issues like this in the past, and it's more than one issue with stupid security warnings. these are simple solutions if the user or developer has no trust issues.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:43
Joined
Oct 29, 2018
Messages
21,454
the steps in the article is what i was pointing to. I've been annoyed by issues like this in the past, and it's more than one issue with stupid security warnings. these are simple solutions if the user or developer has no trust issues.
Oh, the steps. Well, for Access, only steps 1 through 4 apply. Steps 5 and 6 don't apply to Access.
 

vba_php

Forum Troll
Local time
Yesterday, 23:43
Joined
Oct 6, 2019
Messages
2,880
I'd have to verify. I think the steps are at least somewhat outdated.
 

vba_php

Forum Troll
Local time
Yesterday, 23:43
Joined
Oct 6, 2019
Messages
2,880
Okay. Please let us know what you find out.
that won't happen, guy. sorry. I shut the warnings off a long time ago in both 07 and 16, which is what I run.

not to mention the fact that I can't do a reinstall of MS office 365 because I'm getting it for free due to finding a bug in their download. or process, rather. LOL =) I don't mind bragging about that, but do me a favor and don't tell them.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 23:43
Joined
Feb 28, 2001
Messages
27,140
Whatever happened to "Thou shalt not steal" eh? Oh, that's right, you're a hypocrite and don't always truly report what you've done. So we don't know if you have a licensed copy or not.
 

vba_php

Forum Troll
Local time
Yesterday, 23:43
Joined
Oct 6, 2019
Messages
2,880
So we don't know if you have a licensed copy or not.
i don't wear an eyepatch. it IS licensed. I just went through an unusual process due to a billing error on microsoft's end, and apparently they didn't cover that scenario. that's how it happened. I got help from a forum worker over at MS to get it accomplished, was of course all by accident anyway.
 

silversun

Registered User.
Local time
Yesterday, 21:43
Joined
Dec 28, 2012
Messages
204
Sorry, but I don't think that's the same thing. Actually, I don't know if Access has a "protected view,"
As you were guessing, Access has no "Protected View" in there.
Then I tried to add a trusted folder. The folder is added to my local computer here but what about people who don't know or want to do such operations on their computer before they open my application?
It looks like I have to rearrange my pop-up form so that they will know what to do.
Thank you so much for all your helpful comments.
 

isladogs

MVP / VIP
Local time
Today, 05:43
Joined
Jan 14, 2017
Messages
18,209
As the DBGuy stated, you cannot solve this using code as no code will run until the application is trusted

There is a solution to this security warning which I use with my commercial software. However it isn't free.

You will need to purchase a Code Signing Certificate which means software you distribute will be trusted.
You will also need to package your application for distribution using a professional installer.
I use SamLogic Visual Installer Pro but other packages exist such as SSE Setup,

When packaging your application, you need to:
1. Specify the location where the application will be installed.
I use subfolders of C:\Programs\MendipDataSystems but it can be whatever you want
2. Write a script file that runs during installation which saves that location as a trusted location in the registry.
3. Add your code signing certificate to the installation package.

The result is your application is already trusted when it first opens and the security bar / enable content button is never shown
 

silversun

Registered User.
Local time
Yesterday, 21:43
Joined
Dec 28, 2012
Messages
204
As the DBGuy stated, you cannot solve this using code as no code will run until the application is trusted

There is a solution to this security warning which I use with my commercial software. However it isn't free.

You will need to purchase a Code Signing Certificate which means software you distribute will be trusted.
You will also need to package your application for distribution using a professional installer.
I use SamLogic Visual Installer Pro but other packages exist such as SSE Setup,

When packaging your application, you need to:
1. Specify the location where the application will be installed.
I use subfolders of C:\Programs\MendipDataSystems but it can be whatever you want
2. Write a script file that runs during installation which saves that location as a trusted location in the registry.
3. Add your code signing certificate to the installation package.

The result is your application is already trusted when it first opens and the security bar / enable content button is never shown
Very informative comment. Thank you.
Just for my curiosity how much is that Code Signing Certificate?
Installer is required even if the host computer already has MS Access?
 

isladogs

MVP / VIP
Local time
Today, 05:43
Joined
Jan 14, 2017
Messages
18,209
Very informative comment. Thank you.
Just for my curiosity how much is that Code Signing Certificate?
Installer is required even if the host computer already has MS Access?

Both are needed.
The code signing certificate is used to manage the Windows smart screen which will otherwise warn users not to install your application.
The installer is used to do everything else e.g. Setting the location as trusted in the registry

There are two types of code signing certificates. Neither are cheap.
See https://www.ksoftware.net/code-sign...tificate&utm_content=code signing certificate
 

CJ_London

Super Moderator
Staff member
Local time
Today, 05:43
Joined
Feb 19, 2013
Messages
16,607
other point is that the user needs to have windows administrator rights to modify the registry. Not usually a problem for home users, but some IT departments of commercial operations don't allow it.
 

isladogs

MVP / VIP
Local time
Today, 05:43
Joined
Jan 14, 2017
Messages
18,209
True but that can also be handled by the installer.
That is of course as long as the IT department doesn't block users installing files completely.
 

zeroaccess

Active member
Local time
Yesterday, 23:43
Joined
Jan 30, 2020
Messages
671
Our IT department does disable installation of software except by Admins. So, you can try this. Create a new macro and in the blank macro designer, paste this:

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application"><UserInterfaceMacro MinimumClientDesignVersion="14.0.0000.0000"><Statements><ConditionalBlock><If><Condition>Not [CurrentProject].[IsTrusted]</Condition><Statements><Action Name="OpenForm"><Argument Name="FormName">frmStartup</Argument></Action></Statements></If></ConditionalBlock><ConditionalBlock><If><Condition>[CurrentProject].[IsTrusted]</Condition><Statements><Action Name="OpenForm"><Argument Name="FormName">frmLogin</Argument></Action></Statements></If></ConditionalBlock></Statements></UserInterfaceMacro></UserInterfaceMacros>

Save the macro as AutoExec.

On frmStartup, give the user some instructions. Mine says:

Welcome to the XYZ Database. If you are seeing this message, you:

1. Are not opening the database from a Trusted Location, or
2. Simply need to click the "Enable Content" button above

Modify as necessary.
 
Last edited:

Users who are viewing this thread

Top Bottom