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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyone have some "Version Control" Solutions???

Status
Not open for further replies.

Toga

Technical User
Jul 21, 2000
234
0
0
US
Background:
I have an access database on a network that can be accessed from 3 different plant locations. I have the database split into 2 and what I want to do is have the user load the forms / reports section onto their own PC's and access the datafiles from there.

My Problem:
I need assurancce or some sort of process that tells the user he's not using the latest version....and maybe even download it for him. Anyone with a solution out there??? [sig][/sig]
 
Hi Toga,

sort of, what i have done is set up two tables (not much here) but one table (table1) lives in the back end mdb, the other (table2) lives in the user's application. i use this for limited control of user's

table1 has one field a long type which i add a serial number to. the back end mdb has limited access for users (don't want them getting in and stuffing with the data)

table2 has user info (you wouldn't need this!) but on start up i check that the serial number in the front end mdb corresponds to the single entry in the front end mdb if not they can enter it other wise its game over.

the single field table1 is keyed and has a relationship to the single key field in the front end mdb. user can only add a correct serial number(s).

ok that is the story, but this scheme could be adapted so that the front end looks for the field id and checks it with either a local table or a hard coded id in the front end to determine what its actions should be on start up.
you may be able to adapt/extend the idea to control access to the backend mdb ;-)

HTH
Robert

[sig][/sig]
 
I've got a similar situation, with the data .mdb on the main server and the source .mde on the user's own PC's. To make sure they are using the correct version, the code on the opening form checks the 2 versions. I've included the code below -- sorry that it's kind of long, but here you go...

In the source .mdb (or .mde), create a table, 'tblDataPath', containing one field, "FilePath", which holds the full path to the data .mdb's location.

'On load of the first form in the application, check the versions of the data and source .mdb

Private Sub Form_Load()
On Error GoTo Err_Form_Load

Dim MyString As String
Dim intX As Integer
Dim dblocal As Database

Const conNotInCollection = 3265

Set dblocal = CurrentDb

MyString = "My App Version "
MyString = MyString & GetDatabaseProp(dblocal, "Version") 'below

intX = AddAppProperty("AppTitle", dbText, MyString) 'below

RefreshTitleBar 'Access function
CheckVersion 'below

Exit_Form_Load:
Exit Sub

Err_Form_Load:
If Err = conNotInCollection Then
DoCmd.OpenForm "frmDefaultList", acNormal
Resume Exit_Form_Load
End If

' Display the error number and description.
MsgBox "Error " & Err.Number & ": " & Err.Description, vbOKOnly + vbExclamation, "My App"

End Sub

'=====================================================
' GetDatabaseProp: Returns value in user defined database property.
'----------------------------------------------------------
Function GetDatabaseProp(dbDatabase As Database, strPropertyName As String) As Variant

GetDatabaseProp = dbDatabase.Containers!Databases _
.Documents("UserDefined").Properties(strPropertyName).Value

End Function

'=====================================================
' CheckVersion: Checks Application Version based on user
' defined database property.
'-----------------------------------------------------
Function CheckVersion()
On Error GoTo CheckVersion_Err

Dim intX, intY As Integer
Dim AppVersion, DataVersion, MyString As String
Dim dblocal As Database
Dim rstlocal As Recordset
Dim DBRemote As Database

Set dblocal = CurrentDb
Set rstlocal = dblocal.OpenRecordset("tblDataPath", dbOpenTable)

With rstlocal
.MoveFirst
LinkDataPath = rstlocal!Filepath
.Close
End With

Set DBRemote = OpenDatabase(LinkDataPath)

AppVersion = MyString & GetDatabaseProp(dblocal, "Version")
DataVersion = GetDatabaseProp(DBRemote, "Version")

intX = StrComp(AppVersion, DataVersion)
If intX = 0 Then
GoTo CheckVersion_Exit
ElseIf intX = 1 Then
MsgBox "Data MDB version does not match Application.", vbOKOnly
Application.Quit
End If

CheckVersion_Exit:
Exit Function

CheckVersion_Err:
MsgBox "Error " & Err.Number & " occurred while attempting to verify version.", vbOKOnly
Application.Quit

End Function

'=================================================
' AddAppProperty: Creates new or changes database property
'----------------------------------------------------------

Function AddAppProperty(strName As String, varType As Variant, varValue As _
Variant) As Integer
On Error GoTo AddProp_Err

Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
dbs.Properties(strName) = varValue

AddAppProperty = True

AddProp_Bye:
Exit Function

AddProp_Err:
If Err = conPropNotFoundError Then
Set prp = dbs.CreateProperty(strName, varType, varValue)
dbs.Properties.Append prp
Resume
Else
AddAppProperty = False
Resume AddProp_Bye
End If

End Function


Hope this helps,
LynnC [sig][/sig]
 
Thanks everyone...this gives me some good ideas to ponder.

I had a similar idea of my own that I may decide to
undertake.... I was thinking of setting up a table whereas I list any changes I make along with the version #. When a user goes to use his program (located at his remote site) and it accesses the data tables, it will first check this file. If there's a new version, it will download whatever forms / reports / querys that I indicate that I have changed.....before his program actually starts. I was planning on utliizing the "TransferDatabase" object to accomplish this. Now if I can only make it work.

Toga.....

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top