Startup / Login

Gismo

Registered User.
Local time
Today, 06:08
Joined
Jun 12, 2017
Messages
1,298
Hi All,

Please could you assist in a little issue I have

The user click on a batch file on the remote desktop which makes a copy of the DB to the local pc

When the Login from opens, the navigation pane must be hidden as well as the Ribbon.
The system then shows enable contents, not sure how to set the network location to be trusted via VBA and to enable all macros
I can not set the registry as the file are protected by the server protocol
Please could you assist?

also, after they have logged in, the login window is hidden and the Menu Form must open
my issue is, with some users, the menu does not open and the navigation pane is visible

below is my code when DB opens

Private Sub Form_Current()
Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
Call DoCmd.RunCommand(acCmdWindowHide)
DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.SetWarnings 0
DoCmd.SetWarnings False
End Sub

Private Sub Form_Load()
DBEngine.SetOption dbMaxLocksPerFile, 1000000
DBEngine.SetOption dbMaxBufferSize, 500000

DoCmd.Maximize
frmWidth = Me.InsideWidth
frmHeight = Me.InsideHeight
DoCmd.Restore
DoCmd.MoveSize 0, 0, frmWidth, frmHeight
Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
Call DoCmd.RunCommand(acCmdWindowHide)
DoCmd.ShowToolbar "Ribbon", acToolbarYes
DoCmd.SetWarnings (False)
End Sub

and on logging is below code

Private Sub btnLogin_Click()
Dim cboUserName As String
Dim txtPassword As String
Dim rs As Recordset

Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
Call DoCmd.RunCommand(acCmdWindowHide)
DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.SetWarnings False

strCBOPass = Me.cboUserName.Column(1)
strPassword = Me.txtPassword

If strCBOPass = strPassword Then
DoCmd.SetWarnings 0
DoCmd.OpenQuery "Update Registration Select to No"
DoCmd.OpenQuery "Clear_Registration_File"
DoCmd.OpenQuery "Update_Registration_All"
DoCmd.RunMacro "Update Aircraft SerialNo-Reg"
DoCmd.RunMacro "Update DAW Sheet TBL"
DoCmd.OpenForm "Menu"
DoCmd.OpenForm "ChangePassword"

Else
MsgBox "Login Unsuccessful"
Exit Sub
End If

DoCmd.OpenQuery "Update DAW Data with Workpack no - Signon"
DoCmd.OpenQuery "Update User Log - Log In"
DoCmd.SelectObject acModule, "OpenOutlook", True
Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
Call DoCmd.RunCommand(acCmdWindowHide)
DoCmd.ShowToolbar "Ribbon", acToolbarNo

End Sub
 
I can not set the registry as the file are protected by the server protocol
can you clarify what this means - the registry you need to be modifying is your local machine, not the one on the server. Or are you running under citrix/terminal server?

If you cannot modify the registry, then you cannot set trusted locations.
 
can you clarify what this means - the registry you need to be modifying is your local machine, not the one on the server. Or are you running under citrix/terminal server?

If you cannot modify the registry, then you cannot set trusted locations.
we are running Citrix
so we are very limited, if at all, to any modifications on local machine

i am also looking at copying the certificate from my pc then attach it to the batch file but not sure on how to do it and if it will work with our network limitations
 
Hi. Try using a ACCDR. Just a thought...
 
Somebody will prove me wrong, no doubt, but I didn't think you could set a dbs as trusted programmatically. If you could, malware would be able to run with little or no protection, as it could do the same.
 
I didn't think you could set a dbs as trusted programmatically
you can, but not using vba (which has to be trusted before it will run). You need to do it in a batch file or installation app. But if the OP cannot change the registry, not much point

@Gismo - I'm surprised you cannot modify the registry - what happens with macro enabled excel files? they need to be trusted as well. What happens if you manually set a trusted location? If you can do it there, you can modify the registry, at least as far as setting trusted locations is concerned
 
When you have a restrictive IT staff, the trick is to somehow make it clear to that batch auto-updater that your version hasn't changed so you do not need an update. Then just educate the users that if they SEE that yellow "not trusted" banner, they can trust the file and it will retain that trust until you DO download the newer version.
 
you can, but not using vba (which has to be trusted before it will run). You need to do it in a batch file or installation app. But if the OP cannot change the registry, not much point

@Gismo - I'm surprised you cannot modify the registry - what happens with macro enabled excel files? they need to be trusted as well. What happens if you manually set a trusted location? If you can do it there, you can modify the registry, at least as far as setting trusted locations is concerned
I think he means he cannot directly edit registry. Just about everything you do on your computer indirectly edits the registry.

This is where I think Excel actually kinda shines, because there is an approach that will guarantee certain sheets will be hidden until and unless they enable macros, one of my favorite tricks
 
you can, but not using vba (which has to be trusted before it will run). You need to do it in a batch file or installation app. But if the OP cannot change the registry, not much point

@Gismo - I'm surprised you cannot modify the registry - what happens with macro enabled excel files? they need to be trusted as well. What happens if you manually set a trusted location? If you can do it there, you can modify the registry, at least as far as setting trusted locations is concerned
I will most definitely investigate
We don't have much freedom on the network :)
When you have a restrictive IT staff, the trick is to somehow make it clear to that batch auto-updater that your version hasn't changed so you do not need an update. Then just educate the users that if they SEE that yellow "not trusted" banner, they can trust the file and it will retain that trust until you DO download the newer version.
 
When you have a restrictive IT staff, the trick is to somehow make it clear to that batch auto-updater that your version hasn't changed so you do not need an update. Then just educate the users that if they SEE that yellow "not trusted" banner, they can trust the file and it will retain that trust until you DO download the newer version.
I am not sure how to check for latest update
my batch file deletes the file then copies a new file
@ECHO OFF
md %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP
del %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
copy "\\sjo2054\CAMO\DAW Sheet\Engineers\Daw Sheet.accdb" %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
start %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
 
Perhaps you could timestamp the DB to a set date each time?
 
Perhaps you could timestamp the DB to a set date each time?
yes, agree

still, i have no idea how to check for date and then not to update if nor required
below is all i have in my batch file
@ECHO OFF
md %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP
del %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
copy "\\sjo2054\CAMO\DAW Sheet\Engineers\Daw Sheet.accdb" %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
start %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
 
I mean a set date, like 01/01/2020 and that is the date *always*, it never changes?
Whether a change in size triggers the warning I do not know, but worth a try?
 
If your users can open Access the application, NOT your app in their Citrix desktop, you can give them instructions on how to trust the directory you download your app into. If Citrix is set up to just run specific applications rather than give the user a desktop, the user cannot solve this problem for you. In my apps that run under Citrix and also on LANS, the IT department is instructed on what registry keys must be set to allow your app to run as a trusted app. I might be able to find an example for you but your IT people do this by setting the user profile to add these registry keys either ONCE or every time the user logs in.

This is NOT something you can resolve yourself.

The two keys you need will look SOMETHING like the following. You will need to modify the office version and the location names that you want to trust. You might need a third key for the BE location also. Always trust folders rather than files. Then always deploy your Access apps to the same parent folder. If you deploy multiple Access apps,, create a folder C:/AccessParent and then use individual folders below. You might need to also set the "trust subfolders" option since it may not be set by default.

Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations
AllowNetworkLocations REG_DWORD 0x00000001(1)

Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Locationname
AllowSubfolders REG_DWORD 0x00000001(1)
Date REG_SZ 03/06/09 12:57 PM
Description REG_SZ
Path REG_SZ C:\Downloads\
 

Users who are viewing this thread

Back
Top Bottom