FrontEnd Version#: Store/Retrieve?

  • Thread starter Thread starter PeteCresswell
  • Start date Start date
P

PeteCresswell

My tried-and-true approach for storing version numbers in MS Access
apps has been a "Program Changes" table embedded in the front end.
One record for each version. Highest record number indicates current
version.

For reasons beyond my control, this approach cannot be used any more.

Now I need to figure out an alternative method of identifying the
front end's version.

My kneejerk reaction is (code window)|Tools|Properties and using one
of the fields in the UI there.

Is there a widely-used method or should I just go with whatever I come
up with?
 
On Wed, 19 Nov 2008 05:07:03 -0800 (PST), PeteCresswell

I typically use a global constant in modVersionHistory.

-Tom.
Microsoft Access MVP
 
Personally I prefer a Version Date - which I store in a custom database
property. I use these two routines to set and get the version date.

I display the version date on any logon form, splash form, switchboard form,
or about form in my application. If a user/customer calls with a problem one
of my first questions is "What is the version date?".

Public Sub sSetVersionDate(Optional dteDate As Date)
Dim db As DAO.Database
Dim prpNew As DAO.Property
Dim errLoop As Error

If dteDate = CDate(0) Then dteDate = Date

Set db = CurrentDb()
' Attempt to set the property.
On Error GoTo Err_sSetVersionDate
db.Properties("VersionDate") = dteDate
Debug.Print "Version Date set to " & db.Properties("VersionDate")
On Error GoTo 0

Exit Sub

Err_sSetVersionDate:

' Error 3270 means that the property was not found.
If DBEngine.Errors(0).Number = 3270 Then

' Create property, set its value, and append it to the
' Properties collection.
Set prpNew = db.CreateProperty("VersionDate", _
dbDate, dteDate)
db.Properties.Append prpNew
Resume Next
Else
' If different error has occurred, display message.
For Each errLoop In DBEngine.Errors
MsgBox "Error number: " & errLoop.Number & vbCr & _
errLoop.Description
Next errLoop
End If

End Sub

Public Function fGetVersionDate()

fGetVersionDate = CurrentDb().Properties("VersionDate")

End Function


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
I also use custom db properties with similar code, but store majorVersion
and minorVersion numbers. Whenever the FE opens, it checks the same
properties on the BE db. If there are data structure updates to be applied
to the BE, it prompts the user for permission to apply them. If the updates
complete successfully, it updates the property settings on the BE.
 
PeteCresswell said:
My tried-and-true approach for storing version numbers in MS Access
apps has been a "Program Changes" table embedded in the front end.
One record for each version. Highest record number indicates current
version.

I use a table with a single record as this can easily be retrieved
from outside the database. In both the BE and the FE.

I would assume database properties can also be retrieved from outside
the database as well though.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Back
Top