By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Feeding updates from a newer database version (1.1) to an older version (1.0)

mose Mbugua
P: 17
Hi Guys?. When using a program for example an Antivirus, there comes a time when it "tells" you that there is a newer version available. You then decide either to update it or not. Now my question is if that applies to access databases. Lets say after releasing a version of a database, say version 1.0, you then continue adding new features and debugging it. So you call the newer version 1.1. When you want those changes to appear in previous version (1.0), do you have to import the changes or is there another way that you can feed those new features in the previous database versions?
Sep 30 '14 #1
Share this Question
Share on Google+
9 Replies

Expert Mod 2.5K+
P: 3,128

I always have the newest FE on the network. Whenever anyone wants to use the db, I use a command script which copies that front end to the user's local machine. This means that every time I make updates, they are automatically published.

I'm not sure why you would import new features into an old db, or why you would, as a new FE is a new FE.

I'd be glad to share my script if you are interested, but I have it at work and am at home right now.
Sep 30 '14 #2

mose Mbugua
P: 17
i will appreciate that alot.
Sep 30 '14 #3

Expert Mod 2.5K+
P: 3,128
Open Notepad.

Add this text:

Expand|Select|Wrap|Line Numbers
  1. @ECHO OFF
  2. IF NOT EXIST %userprofile%\Documents\DBUser\[Your DB Name].accde MKDIR %userprofile%\Documents\DBUser
  3. COPY [\\Network Location\NetworkFolder\Database Folder\[Your DB Name].accde %userprofile%\Documents\DBUser\[Your DB Name].accde /Y
  4. START /I "MSAccess.exe" %userprofile%\Documents\DBUser\[Your DB Name].accde
Save this file with the ".cmd" extension. Save it in your network location. Any shortcuts to the DB, should actually point to this file.

This file will copy the shared FE from the Network, down to the User's machine, then open it from there.

This makes sure every time a user opens the DB, it is the latest version.
Sep 30 '14 #4

Expert 100+
P: 1,107
Coincidently, I was about to create a deployment script when this post showed up. Gotta love it when the code you need finds you. Thanks Twinnyfo!

I took your approach and took it a step further. We have multiple locations across the Midwest, but I want to deploy from one location. Copying the file every time the application is launched could cause some frustration when it's being copied between locations 400 miles apart. So, I added a version .txt file allowing the file copy only to take place if there is a new version.

Since I borrowed the code in the first place, I thought I would give back.

Expand|Select|Wrap|Line Numbers
  1. @ECHO OFF
  2. CLS
  3. SET gSourceLocation=\\tserver\Applications\MHSC\
  4. SET gAppFileName=MHSC.accde
  5. SET gVersionFileName=MHSC.txt
  6. SET gAppDir=Documents\Applications\
  8. SET sUserProfile=%userprofile%
  9. SET sSourceFile=%gSourceLocation%%gAppFileName%
  10. SET sSourceVersionFile=%gSourceLocation%%gVersionFileName%
  12. SET sDestination=%sUserProfile%\%gAppDir%
  13. SET sDestinationFile=%sDestination%%gAppFileName%
  14. SET sDestinationVersionFile=%sDestination%%gVersionFileName%
  16. SET sSourceVersion=0
  17. SET sDestinationVersion=0
  19. SET /p sSourceVersion=<%sSourceVersionFile%
  20. SET /p sDestinationVersion=<%sDestinationVersionFile%
  21. IF "%sDestinationVersion%"=="" (SET sDestinationVersion=0)
  23. ECHO ........................................
  24. ECHO Source Version File: %sSourceVersionFile%
  25. ECHO Current Version File: %sDestinationVersionFile%
  26. ECHO ........................................
  27. ECHO Application: %sSourceFile%
  28. ECHO Local Directory: %sDestination%
  29. ECHO Current Version: %sDestinationVersion%
  30. ECHO Availiable Version: %sSourceVersion%
  31. ECHO ........................................
  33. IF NOT EXIST %sDestination% (
  34. ECHO Making Destination Directory...
  35. MKDIR %sDestination%
  36. )
  38. IF  %sDestinationVersion% LSS %sSourceVersion% (
  39. ECHO Installing latest version of the Application to this computer
  40. ECHO Please be patient, this should take no more than 30 Seconds...
  41. COPY %sSourceFile% %sDestination%
  42. ECHO Copying Version File to Local Computer...
  43. COPY %sSourceVersionFile% %sDestination%
  44. )
  46. START "MSAccess.exe" %sDestinationFile%
To use this, update the four "constants" at the top to reflect your environment. Then create a text file (mine is called MHSC.txt) and put a version number in it.
Then give your users a link to it. Finally, when you have a new version of the code available, Increment the number in the .txt file
Oct 2 '14 #5

Expert Mod 2.5K+
P: 3,128

Great script! I like it. I admit I know very little about Command Scripting, hence the very basic nature of my version.

I think I may also add some code to my FE, such that when I compile and relink all my tables (which I do programatically), it will automatiaclly update the version text file. Then I woun't forget.....

Thanks again!
Oct 3 '14 #6

Expert 100+
P: 1,107
That is an incredible idea. I think I'll work on that today. =)
Thanks again!
Oct 3 '14 #7

Expert Mod 2.5K+
P: 3,128
Here is my go at it--I'm sure there are probably better ways to do it....

Expand|Select|Wrap|Line Numbers
  1. Public Sub UpdateVersion()
  2. On Error GoTo EH
  3.     Dim oFSO As FileSystemObject
  4.     Dim oTS As TextStream
  5.     Dim oTSTemp As TextStream
  6.     Dim strTemp As String
  7.     Dim strText As String
  8.     Dim intVersion As Integer
  9.     strTemp = gstrVersionFile & "tmp"
  10.     Set oFSO = New FileSystemObject
  11.     Set oTS = oFSO.OpenTextFile(gstrVersionFile)
  12.     strText = oTS.ReadLine
  13.     oTS.Close
  14.     Set oTS = Nothing
  15.     Set oTSTemp = oFSO.CreateTextFile(strTemp)
  16.     intVersion = CInt(strText)
  17.     intVersion = intVersion + 1
  18.     oTSTemp.WriteLine intVersion
  19.     oTSTemp.Close
  20.     set oTSTemp = Nothing
  21.     oFSO.DeleteFile gstrVersionFile, True
  22.     oFSO.MoveFile strTemp, gstrVersionFile
  23.     Set oFSO = Nothing
  24.     Exit Sub
  25. EH:
  26.     MsgBox "There was an error updating the version text.  " & _
  27.         "Please contact your Database Administrator.", vbCritical, "Error!"
  28.     Resume Next
  29. End Sub
gstrVersionFile is a global variable with the path and file name.
Oct 3 '14 #8

Expert 100+
P: 1,107
Thank you. I stole your code. =)
Oct 3 '14 #9

Expert Mod 2.5K+
P: 3,128
Serves me right for stealing yours!

Oct 3 '14 #10

Post your reply

Sign in to post your reply or Sign up for a free account.