Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Update users front end objects based on version

Status
Not open for further replies.

fun4me

Programmer
Apr 10, 2003
13
US
I have a front-end on users desktop and backend on network along with the security file. Has anyone written code to automically look at perhaps a version the user has and if they don't have the most recent one copy the new one down to their desktop? Should i go about this with a full copy of the database or should i figure out only the new objects?

Any help would be appreciated!

 
I have a table that defines everything I need to know about a pc that contains a copy of my front-end database. It contains the name of the pc, the name of the primary user, their telephone number and location, a "new version" flag that, when set, indicates that a new copy of the front-end database needs to be copied to the machine. It also contains a date/time stamp which indicates which version of the database is loaded on the machine, an "Exit Now" flag, and a "Broadcase Message" flag. I also store the name of the front-end database in this record because I could have more than one database (different projects) running on a user's machine. I store other info in this table also, but these are the main things.

At startup, a function is called to, first determine if the pc has been registered (i.e. pc's name exists in the table). If not, then a form is displayed that asks the user to enter the above info (the name of the pc is obtained programatically). If the pc has already been "registered", then it checks to see if the "new version" flag is set. If so, then the current version of the front-end database is deleted from the user's machine, a new version of the front-end is copied to the user's machine, and the "new version" flag is cleared.

I use a date/time stamp as my version number indicator and store the date/time as a custom property in the Database Properties. After I make changes to my database, and prior to releasing it to the users, I set this property to the current system date/time. After the new version is copied to the user's machine, I set the date/time field of the pc registration table equal to this custom property. This way I can look at the table to see which version of my database exists on each pc. (Note that the user will always run the most current version because it is automatically copied to the users' machine at startup.)

It may seem like a lot to set up, but if you create a library database (consisting of a front-end and back-end), you can use this method with every database you create. Simply store, in the front-end, the "registration form", the function that checks to see if the pc is registered, and the function that launches the code to copy a new version to the users' machine. Store the registration table in the back-end.

Also, by storing all of this information in a library database, you can continue to add stuff to your library and the registration table will come in handy for some of this "stuff". For example, suppose you want everyone to log out of your application. And suppose your program was able to kick everyone out but one. You can then determine who is logged into your application (based on user name) and join this with the registration table to determine their phone number and location. This is just one example of how the registration table can be very handy to have in supporting systems.

You could just have a table that contains just the "new version" flag. But it will only take you a couple more minutes to add the other fields to the table.

These are the things you will need to make this work.
1. Library database (front-end)
2. Library database (back-end)
3. Code to determine name of pc (can be found in this forum)
4. Code to copy new database to user's pc (can be found in this forum)
 
I wrote a little update program in Visual Basic for our in-house system. There is a table on the (SQL) server that holds the current version, which is replicated as a public constant within the front end database. As soon as the database starts up it compares the versions. If they do not match it then shells the update program and quits Access. The update program waits for Access to close, then copies the entire database from the publication point and fires it up. The whole update process takes less than a minute.

You could possibly do this with a batch file, but you need to wait for Access to close down before attempting to overwrite the database. You could maybe shell the AT command (Windows NT4/2000/XP only) to schedule the batch file to run in one minute.
 
I use a batch file to roll out new versions of my FE. JeremyNYC has a great example on his website. Basically the user has a shortcut to the batch file on their desktop (with an Access icon). the batch file looks for a text file for the version. If the latest version is not found, the batch file copies the FE to the users computer and starts Access. its really simple and highly effective.

JASON

______________________________
Sleep is a poor substitute for coffee.
 
There are several variations on this theme sprinkled throughout the various fora in Tek-Tips. Many of the approaches have their own adherents. My choice is not mentioned in the above, but involves copying ONLY the changed objects to the app instance which needs to updated. Normally, I would just 'shoo' you to 'advanced' search with a few 'key words and tricky phrases', alas alack and awry, the search process is -perhaps- less robust than this and would probably not find the specific reference I would propose. see thread181-30072 (it is somewhat old, but as far as i know it did wend it's way to a (in my opinion) quite reasobable soloution, requiring nothing more that 'good' dicipline and a link between a Master / Design copy of the app and hte various sesktop versions.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
All - those are all good ideas but another question.
Can you copy a front end and backend that have security workgroup file associated with them? How exactly or doesn't it affect mdw file?

 
It doesn't matter whether you're using security or not. But I don't understand why you would want to copy the back-end. Ususally the back-end resides on a server (as well as the mdw file) so that all users have access to it.
 
OOPS - Just not thinking your right :eek:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top