UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Trap Security Warning?, Access 2013    
 
   
BattleCat
post Jun 23 2017, 10:43 AM
Post#1



Posts: 270
Joined: 15-May 14
From: USA


I am trying to make my database tool dummy free. I get the same people telling me that nothing works and it turns out the security warning is on and they need to enable content. The database is split with the BE on a network drive. I want to capture the security warning and have a pop up form tell the user to allow content by clicking a button. That button will enable content then give them access to the tool. Does anyone know if this is possible?
Attached File(s)
Attached File  warning.jpg ( 10.03K )Number of downloads: 3
 

--------------------
BattleCat
Go to the top of the page
 
theDBguy
post Jun 23 2017, 10:49 AM
Post#2


Access Wiki and Forums Moderator
Posts: 71,196
Joined: 19-June 07
From: SunnySandyEggo


Hi,

It's a catch-22 but there might be a workaround. The default behavior is for Access to disable all code until the file is trusted, which means any code you try to use to detect if the content is enabled won't run if the content is not enabled, which means you can't show a message box to tell the user to enable content.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
nuclear_nick
post Jun 23 2017, 10:54 AM
Post#3



Posts: 1,391
Joined: 5-February 06
From: Ohio, USA


My set up is to use a two-step FE process.

First FE is a 'splash' db, with hardly any code, and just a simple form that says, basically, 'Click Here To Log In'.

If they trust the code, then more code runs, setting up (trusting locations, copying any new versions of FE...), and then running the full-blown FE.

If they have not trusted the code... the 'splash' db closes (via macro). That's it. No database for you!

So basically, in order to log in to the 'system', (which some do, in order to do their job... smile.gif ), they have to trust me. smile.gif And they don't get a half-hearted attempt at opening what would have been their database if they didn't trust the code, making it look like it's my fault... they get nothing at all. smile.gif

Anyways... that's my system.

--------------------
"Nuclear" Nick
____________
The top three reasons to hide code; 1) It's not your own. 2) It's your own, but it's so crappy you don't want anyone to see it. 3) The comments in your code would get you in a lot of trouble if ever made public.
Go to the top of the page
 
theDBguy
post Jun 23 2017, 11:11 AM
Post#4


Access Wiki and Forums Moderator
Posts: 71,196
Joined: 19-June 07
From: SunnySandyEggo


Hi Nick,

If I understand it correctly, if I was a first-time user of your app, you would give me a copy of the "splash" db.

When I try to open it, I might see the button but clicking it won't do anything because I haven't enabled content yet, correct?

If so, how will the macro know to close the application (at this time) because I haven't trusted your app?

Just wondering...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
BattleCat
post Jun 23 2017, 11:23 AM
Post#5



Posts: 270
Joined: 15-May 14
From: USA


Hi Nick, Can you share how you have the trust center coded?




Thanks

--------------------
BattleCat
Go to the top of the page
 
BattleCat
post Jun 23 2017, 11:46 AM
Post#6



Posts: 270
Joined: 15-May 14
From: USA


QUOTE
The default behavior is for Access to disable all code until the file is trusted, which means any code you try to use to detect if the content is enabled won't run if the content is not enabled, which means you can't show a message box to tell the user to enable content.





@theDBguy, I can still have a form load with a message to enable content before it is enabled, but I would like for it to not display if they have already enabled it once so I still need a code I can trap and put in an if else statement.

--------------------
BattleCat
Go to the top of the page
 
theDBguy
post Jun 23 2017, 12:02 PM
Post#7


Access Wiki and Forums Moderator
Posts: 71,196
Joined: 19-June 07
From: SunnySandyEggo


"@theDBguy, I can still have a form load with a message to enable content before it is enabled, but I would like for it to not display if they have already enabled it once so I still need a code I can trap and put in an if else statement."

This reminds me of those bumper stickers saying: "If you can read this, you're driving too close."

So, if you select the warning form as your Default form in Current Database Options, Access will display the form/message whether the file is trusted or not. However, if the file is trusted, you can have code in the Open event of the default form to close itself and open the actual form you want the user to see.

Hope it helps...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
nuclear_nick
post Jun 23 2017, 01:39 PM
Post#8



Posts: 1,391
Joined: 5-February 06
From: Ohio, USA


dbG,

Heh... had to go back and look. Actually what people get is a link to a 'links' folder where there are shortcuts to other 'apps'. (I didn't write them all... but I'm working on it. smile.gif ). We get an alert from management sometimes on new hires, personnel moves, so we can be ready and send them an email when the time comes.

When the button is clicked (the login button), it doesn't do anything, unless the button on the yellow bar (or if you get the warning in the center) has been clicked. So it doesn't close... it just doesn't do anything, until they see the warning and say 'Okay'.

There is a timer on the form, which runs a macro that will close the application if they leave it up too long (90,000 is what the interval is set to), but it's been in place for going on 7 years now, so I don't recall if that works before trusting it or not.

BattleCat,

'Trust Center' coding is available on this site, I believe in the Wiki section. smile.gif

--------------------
"Nuclear" Nick
____________
The top three reasons to hide code; 1) It's not your own. 2) It's your own, but it's so crappy you don't want anyone to see it. 3) The comments in your code would get you in a lot of trouble if ever made public.
Go to the top of the page
 
theDBguy
post Jun 23 2017, 01:43 PM
Post#9


Access Wiki and Forums Moderator
Posts: 71,196
Joined: 19-June 07
From: SunnySandyEggo


Hi Nick,

Thanks for the clarification.

BattleCat,

I was going to test your idea but stumbled on the answer instead. It turns out, Access provides a property called "IsTrusted" to indicated whether an app is trusted or not.

Take a look at the attached and see what happens.

Hope it helps...
Attached File(s)
Attached File  IsTrusted.zip ( 17.78K )Number of downloads: 23
 

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
BattleCat
post Jun 23 2017, 02:12 PM
Post#10



Posts: 270
Joined: 15-May 14
From: USA


I saw this and made an if statement with it and it works. Thank you very much. It's nice to find the answer after spending all day looking for it, only to ask for help, then find it and have help share it with me. Thanks guys!

--------------------
BattleCat
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    11th December 2017 - 12:56 AM