Allow trusted locations on my network vba (1 Viewer)

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
Hi,

please advise if it is possible when DB opens to "set allow trusted locations on my network" with a vba code

the users gets a "enable contents" every time they open the new copied file from the batch file

this will assist me to not have to go to each user to allow the network location
 

Attachments

  • 1606744591925.png
    1606744591925.png
    46.4 KB · Views: 208

theDBguy

I’m here to help
Staff member
Local time
Today, 05:44
Joined
Oct 29, 2018
Messages
21,358
Hi. If your db is not yet trusted, then no VB code will execute, which means you can't use VBA to set trusted location.

You can use VBA to set trusted location once the db is trusted. Catch 22.

However, you can use other means to set trusted locations, like VB scripting.
 

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
Hi. If your db is not yet trusted, then no VB code will execute, which means you can't use VBA to set trusted location.

You can use VBA to set trusted location once the db is trusted. Catch 22.

However, you can use other means to set trusted locations, like VB scripting.
my DB is set as trusted but the settings does not seem to copy, if it should copy at all, then the other users opens their copy of the DB
so i need to go to each user to set trusted location

correct?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:44
Joined
Oct 29, 2018
Messages
21,358
my DB is set as trusted but the settings does not seem to copy, if it should copy at all, then the other users opens their copy of the DB
so i need to go to each user to set trusted location

correct?
Once a trusted location is set, it should stay set. Are you talking about the FE copy on each user's machine? If so, luke I said earlier, rather than use VBA to copy/install the FE, try using VB script instead.
 

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
Once a trusted location is set, it should stay set. Are you talking about the FE copy on each user's machine? If so, luke I said earlier, rather than use VBA to copy/install the FE, try using VB script instead.
yes I am referring to the FE

please advise on the script to use
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:44
Joined
Oct 29, 2018
Messages
21,358
yes I am referring to the FE

please advise on the script to use
Hi. This might be easier for you. Maybe you could give it a try. It will create an installer for your FE, and you can include the Trusted Location settings in the installer.

 

isladogs

MVP / VIP
Local time
Today, 12:44
Joined
Jan 14, 2017
Messages
18,186
Another way is to distribute a registry (.reg) file containing trusted location info with your application.
The end user runs the file before opening the Access app and it will therefore already be trusted on first use.

This is exactly the same process as is used in any professional installer application - not just with SSE
 

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
Another way is to distribute a registry (.reg) file containing trusted location info with your application.
The end user runs the file before opening the Access app and it will therefore already be trusted on first use.

This is exactly the same process as is used in any professional installer application - not just with SSE
I have a .bat file which copies the latest version onto the remote desktop pc, then opens the DB
i will look into it to add this .reg file to the .bat file
i am not familiar with the .reg file so i will have to investigate but sounds like a viable option
 

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
Hi. This might be easier for you. Maybe you could give it a try. It will create an installer for your FE, and you can include the Trusted Location settings in the installer.

will definitely look into this
 

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
S
Let us know what you find out. Good luck!
Hi,

I spoke to our IT guy
i will not be able to load a Reg file with DB file as the network policy will decline the update
so, we will have to click on enable contents every time when the open the DB

thank you for al this assistance though, much appreciated
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:44
Joined
Oct 29, 2018
Messages
21,358
S

Hi,

I spoke to our IT guy
i will not be able to load a Reg file with DB file as the network policy will decline the update
so, we will have to click on enable contents every time when the open the DB

thank you for al this assistance though, much appreciated
Every time? Are you sure? Normally, you just need to do it once.
 

Gismo

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2017
Messages
1,298
Every time? Are you sure? Normally, you just need to do it once.
yes, every time
the batch file copies the file from the original location then saves a new copy every time, in case of new updates
 

isladogs

MVP / VIP
Local time
Today, 12:44
Joined
Jan 14, 2017
Messages
18,186
There are two methods of managing trusted status. Each involves a registry entry

1. Trusted documents - the file itself is trusted by clicking Enable Content on the security bar
If that is the approach used, it would indeed need to be done each time a new file is downloaded

In that case, I would revert to running a version check on the FE and only downloading a new version when one is available.
At least then it would only be done once.

2. Trusted locations - this only needs to be done once.
By doing that the new file will automatically be trusted on download
In your position, I would ask your IT team to run a registry file on each workstation trusting the location of the FE file
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:44
Joined
Oct 29, 2018
Messages
21,358
yes, every time
the batch file copies the file from the original location then saves a new copy every time, in case of new updates
Okay, maybe it depends on the environment. All I know is if I click on the Enable Content button for an ACCDB file, the filepath/filename of the file is added to the Trusted Documents list, and as long as I don't change the file name, it always worked. I don't have to click on Enable Content again, even if I delete that file and replace it with a new version with the same file name.
 

Users who are viewing this thread

Top Bottom