Send Keys to upgrade front end

kevnaff

Member
Local time
Today, 20:23
Joined
Mar 25, 2021
Messages
174
Hello All.

My database used to automatically update itself using a .bat installation batch file. However our IT team now block us from using this method.

Currently users have to go to the shared drive and copy the front end file and paste it on to their C:Drive to overwrite it. As the database is currently going through quit a lot of small updates, I am hoping to make this process automated.

So far when the database is opened, it compares the user's current version number with the latest available version number. If the latest version number is higher than the user's current version, then it will run the following code:

Code:
Dim stPath As String
Dim stAppName As String

stPath = "C:\Medipro\MediproUpgradeTool.accdb"

stAppName = "msaccess.exe " & stPath
Call Shell(stAppName, 1)

DoCmd.CloseDatabase

Exit Sub

This code opens up a new access database which will hopefully carry out the upgrade. The upgrade tool database opens up, and the user will hit an upgrade now button. I want this command to do the following:

Copy the Medipro Front End.accde file from the file path "Groups\Medical Engineering\Medipro\"

Paste the .accde file to a new filepath and overwrite the exisiting .accde file in the file path "C:\Medipro\"

Is it possible to do this using send keys?

I am limited to what I am able to do due to IT limiting our rights.

Any help is greatly appreciated.

Thanks
 
I used to do auto-update with code that would copy file to user C:\ location (couldn't copy into user folder) then IT replaced computers and further limited permissions, can no longer programmatically copy files. Best I could do was alert user there is a new version and open the folder with the frontend to copy. Then they would manually copy to C:\ location.

I don't see how SendKeys can perform a copy/paste action and if they could, how that would circumvent permission limitations. It's still programmatically copying a file.
 
Have you reviewed some of the options in the Similar Threads at the bottom of the page?
Read through Update Front End started by Kayleigh
 
Hello All.

My database used to automatically update itself using a .bat installation batch file. However our IT team now block us from using this method.

Currently users have to go to the shared drive and copy the front end file and paste it on to their C:Drive to overwrite it. As the database is currently going through quit a lot of small updates, I am hoping to make this process automated.

So far when the database is opened, it compares the user's current version number with the latest available version number. If the latest version number is higher than the user's current version, then it will run the following code:

Code:
Dim stPath As String
Dim stAppName As String

stPath = "C:\Medipro\MediproUpgradeTool.accdb"

stAppName = "msaccess.exe " & stPath
Call Shell(stAppName, 1)

DoCmd.CloseDatabase

Exit Sub

This code opens up a new access database which will hopefully carry out the upgrade. The upgrade tool database opens up, and the user will hit an upgrade now button. I want this command to do the following:

Copy the Medipro Front End.accde file from the file path "Groups\Medical Engineering\Medipro\"

Paste the .accde file to a new filepath and overwrite the exisiting .accde file in the file path "C:\Medipro\"

Is it possible to do this using send keys?

I am limited to what I am able to do due to IT limiting our rights.

Any help is greatly appreciated.

Thanks
Pass on the chore of upgrading the DB to IT then?
Advise them when a new version is a available and let them update the systems.
Our computers in the bank used to get updates overnight.

If they can physically copy the DB from the master location to their computers, then you should be able to do it with VBA?
 
However our IT team now block us from using this method.
If IT is preventing you from updating the database with a new version, then I agree with Gasman, they need to take responsibility for doing it for you. This is too important to be left to users. Adding a version check in the app is critical if you are not doing automatic updates but I'm pretty sure the new method is going to fail for the same reason the old method now fails. They don't want software automatically copying files from the server to the local drive.

Ask them to push a new copy of the FE as part of the user's log on using Group Policy. Then your version message can tell the user to reboot to get the latest version if you have to release an emergency version mid-day. Doing the push automatically on boot up eliminates manual work on your part AND on their part so they probably won't argue with you about this. I don't think you want to agree to a method where you have to notify them and they have to run an update at that time. If it happens mid-day, it will force everyone to have to log off because their file can't be updated if it is open. Then what happens if the person is away from their desk. Is IT going to force boot their system? Avoid this path if at all possible.
 
Last edited:
When I encountered this issue, there was no way IT was going to help. Access was not an 'official' db program. Oracle was the approved db standard and that had to be managed by an office 800 miles away. They allowed Access to be installed with Office package but users were on their own. Zero IT support for programming development with any of the MS apps.
 
Last edited:
If IT is preventing you from updating the database with a new version
I think IT prevents running bat files, not updating a FE. If I was an IT somewhere, preventing running bat files (specially with admin rights) was the first thing I would do.

@kevnaff
This is a link to a post from @isladogs for updating with API. It's very simple and very fast. And since it's simply copying a file, it can still be run under restricted situations.
You may want to give it a try.

@arnelgp had a very nice version too. But I can't find it. I hope he can chime in.
 
AutoFeUpdater is a very tidy tool with some other great management features for the developer at a very reasonable price. You might have to get IT to allow it to run though, if not now, later as they increase their stranglehold on what can run.

However IT could distribute the file from any nominated location using the file distribution in Group Policy which has Update options.

Oh how I love not having to have these fights with IT, being the dba on our dbms as well as a domain administrator.
 
Thanks all for your help.

I have used the post from Isladogs that KitaYama suggested a couple of posts above. This works a treat.

I am now going to have my front end open, and check the version number. If the version number is below the latest version, it will first close the user's front end and then open up the Upgrade Tool .accde.

Once the .accde opens it will then run the code On Open, from the Isladogs post. This will copy over the front end, close the upgrade tool, and then reopen the user's newly updated front end.

This is all in theory at the moment, I'm still yet to implement it. But it seems like it should work.

Thanks again everyone, very helpful.
 
@kevnaff
I've been using this method for years .... It definitely works

If you want to practice on a different file suggest you try my example app:

BTW It was only pure chance that I saw your post
If you add an '@' before a username (as I did above), that user will get a notification
 
@isladogs Thanks for the tips, much appreciated.

Does anybody know of any way to open a .exe using a similar method?

Our IT department have blocked us using the following code:

Code:
Rem On Error GoTo Err_CommandQA90Home_Click

    Dim stAppName As String
    Dim stHomepath As String
    
    stHomepath = CurDir
    

    Rem stAppName = stHomepath & "\QA90PRO32\Qa90pro.exe"
    stAppName = "H:\QA90PRO32\Qa90pro.exe"
    Call Shell(stAppName, 1)

Exit_CommandQA90Home_Click:
    Exit Sub

Err_CommandQA90Home_Click:
    MsgBox Err.Description
    Resume Exit_CommandQA90Home_Click

I imagine there's a way of doing this, but I've no idea where to start.
 

@arnelgp had a very nice version too. But I can't find it. I hope he can chime in.

@KitaYama
Apparently, you talked about this version app:
access-programmers.co.uk/forums/threads/autoupdate-front-end.318279/#post-1771745
Sorry, but the system of the site does not allow, it is normal to specify a link to the post from @arnelgp
 
Last edited:

Users who are viewing this thread

Back
Top Bottom