Updating the front end on local server (1 Viewer)

oxicottin

Learning by pecking away....
Local time
Today, 17:07
Joined
Jun 26, 2007
Messages
856
Hello, I always wanted to know how to update the Fe and Be using a version number. Currently I have the Be in a folder on the local server and I distribute the Fe to each employee. Is there a way when I update the FE each person using the database FE when open it runs a version check and if its a new version tells them to update or auto updates would be best. If this isn't possible then that's fine...

Thanks,
 

Isaac

Lifelong Learner
Local time
Today, 14:07
Joined
Mar 14, 2017
Messages
8,777
I used to use Bob Larson's Auto FE updater.

If you can't find his you can easily re create it, the basic idea is:
1) have a local Version table in the front end
2) have a Version table in the back end (linked in the front end)
3) each time you deploy a new version, enter the same, new, version # in the only record which exists in each table.
4) in your startup form, have code to check their [local] version table against the [network] version table. if different, use code to quit the application immediately after the line of code that creates and executes a BAT file - with a several second delay - which copies the network file over to their local location and re-opens the db.

Nowadays I more often just give them a desktop shortcut to a vbs file which always copies the network FE to their local folder.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:07
Joined
Aug 30, 2003
Messages
36,124
I've used similar methods, though I use a version table that keeps a history so I grab the max version. I also did it from outside the db rather than from inside. I've used either Access, VB6, or C# to create little apps that check for the required folder first, create it if necessary, then copy the db if the local version is behind. Then it starts the local version.

That said, I've also gone the route of just copying the file all the time, though it was because I ran into an issue grabbing the version from a 64bit accde from C#. Probably should have used vbs but I was trying to teach myself C#.
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:07
Joined
Sep 21, 2011
Messages
14,238
A simple search here would provide as one of the links


I have posted it several times for others asking the same question.?

Others favour copying the FE each time it is asked to open.

HTH

Edit: Here is one of the threads where I posted where there is a link to Bob Larsen's code.

 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:07
Joined
Feb 19, 2002
Messages
43,233
I use a batch file. The user runs a shortcut. The shortcut runs a batch file. The batch file creates a directory, copies down the current version, and then opens it. This method doesn't check versions, it ALWAYS copies a new version each time it opens. It is a simpler solution and has the benefit of eliminating the need to ever compact the FE.
 

oxicottin

Learning by pecking away....
Local time
Today, 17:07
Joined
Jun 26, 2007
Messages
856
I downloaded Bobs program and it works great but I wanted to try and automate it some. I added after you select your FE it automatically fills out where your keeping the master .accde for distributing the folder being called".accde Distribution Folder".

My question is there any way instead of having to copy the code from his frm_CodePaste it would find the opening form of your DB FE and inset in into the OnLoad Event for you and then make a copy of the DB as a .accde and place it in the ".accde Distribution Folder"?

Is that even possible?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:07
Joined
Feb 19, 2002
Messages
43,233
If you want to display this information on a form, have the loader update a table. Then the form can get the data from the table.
 

Isaac

Lifelong Learner
Local time
Today, 14:07
Joined
Mar 14, 2017
Messages
8,777
I had some trouble following your question, but you must have found a different "Bobs program" than the one I used.
the one I used already WAS automated, and wasn't really a program to download.....just a few simple steps to follow and a few lines of code to check the version (steps to take posted earlier in this thread).
Regardless, I think you're talking about extensibility, which I wouldn't recommend messing with for a relatively unimportant reason, honestly.
 

oxicottin

Learning by pecking away....
Local time
Today, 17:07
Joined
Jun 26, 2007
Messages
856
Ye I have the same one I just wanted to see if it can be done and give it a go... It works pressing a few buttons and pasting some code in your FE ect and updating your tables.

Thanks,
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:07
Joined
Sep 21, 2011
Messages
14,238
I downloaded Bobs program and it works great but I wanted to try and automate it some. I added after you select your FE it automatically fills out where your keeping the master .accde for distributing the folder being called".accde Distribution Folder".

My question is there any way instead of having to copy the code from his frm_CodePaste it would find the opening form of your DB FE and inset in into the OnLoad Event for you and then make a copy of the DB as a .accde and place it in the ".accde Distribution Folder"?

Is that even possible?
I seem to recall you only have to paste it once? :unsure:
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:07
Joined
Oct 29, 2018
Messages
21,454
Yes but I wanted to automate the pasting from bobs DB into the FE startup form onload event.
Curious. Can you describe your actual setup and explain how you plan to implement Bob's solution? As others have said, you have to do some prior setup to be able to use it, but that setup should only be done once. Are you saying you want to automate Bob's solution on multiple projects/dbs?
 

Isaac

Lifelong Learner
Local time
Today, 14:07
Joined
Mar 14, 2017
Messages
8,777
Ok, I think I'm beginning to understand what you're saying.
You are trying to make the move, to go FROM your current system (everyone has a distributed FE, but no method of auto-distributing new versions), TO an auto FE updater scenario, and you are looking for a way to "automatically" make that switch as a one time deal. (since next time of course, it will be automatic).
My personal view is it's not worth the effort unless you're talking about hundreds or thousands of users. Just convince them to manually grab the new updated version one time.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:07
Joined
Feb 19, 2002
Messages
43,233
If you use the batch file method I suggested, you do not have to change the application. You do have to distribute a new shortcut for everyone to use though. But, this is a one time event.
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 22:07
Joined
Feb 5, 2019
Messages
293
If you use the batch file method I suggested, you do not have to change the application. You do have to distribute a new shortcut for everyone to use though. But, this is a one time event.
Hi Pat,

Would it be possible to see the code you use please? This would be very helpful for me. I have over 20 users and at the moment I have a front end folder they link to on the server and I have to update these manually when people have logged out. Your method would help me greatly.

~Matt
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:07
Joined
Feb 19, 2002
Messages
43,233
This is the batch file used for normal LAN operation.
Code:
md c:\DwgLog
del c:\DwgLog\DrawingLog.accdb
copy "\\BSCCTIMBERLINE1\Timberline Office\AccessApps\Data\CommonFE\DrawingLog.accdb" c:\DwgLog
c:\DwgLog\DrawingLog.accdb
This is the file used for Citrix or RDP oeration.
Code:
md %USERPROFILE%\DwgLog
del %USERPROFILE%\DwgLog\DrawingLog.accdb
copy "\\BSCCTIMBERLINE1\Timberline Office\AccessApps\Data\CommonFE\DrawingLog.accdb" %USERPROFILE%\DwgLog
%USERPROFILE%\DwgLog\DrawingLog.accdb

The difference is that you can hard-code the target locations if you are running on a standard LAN but with the other environments, you need to use the users personal directory as the target location.

As you can see, there is no error checking code in the script. None is actually needed. If the directory already exists, the md doesn't raise an error and for the del, if the file doesn't exist, that also doesn't raise an error. I've seen scripts that go on for pages but this is all I've ever needed.
 

oxicottin

Learning by pecking away....
Local time
Today, 17:07
Joined
Jun 26, 2007
Messages
856
Using Bobs DB it doesn't create a link from (tbl-version_fe_master) in the BE to the FE. I tried the VBA below and it creates the link but to bobs utility, how do I get it to link the another DB using strFEFile = Me.txtFEMaster

Code:
   Dim strFEFile As String
    Dim strBEFile As String
    
    strBEFile = Me.txtBackEnd
    strFEFile = Me.txtFEMaster
    
    DoCmd.TransferDatabase acLink, "Microsoft Access", strBEFile, acTable, "tbl-version_fe_master", "tbl-version_fe_master"
 

Users who are viewing this thread

Top Bottom