1

I've started to run into some concurrency issues with my databases. I have roughly ten different aacdb files in a shared location on our office network. One of these databases is kind of the 'master' database. It is split into backend and front end. The backend of this databases holds common tables such as users/passwords, employees, departments, etc etc.

Yesterday, I made two databases purely for input. They each have a single form bound to a table in 'data entry' mode, with record locks set to 'edited record.' They also link to some of the same tables shared by other databases. This is where I started to run into (likely?) concurrency issues for the first time.

People have been reporting odd behavior (forms not opening, etc) in the 'master' database. This was tested a bit and only happens when users are also in the linked data-entry only databases.

There are still less than ten current users across all of the databases at a given time.

Would drop down selections hold a lock on a table, preventing certain forms from opening? AFAIK, dropdowns are just queried when the form is loaded.

Any ideas?

Scotch
  • 3,186
  • 11
  • 35
  • 50
  • The front end is also located on the shared location. The users open the same front end file. I'm always developing, so I don't want to have to redistribute the front end pretty much daily. – Scotch Jan 10 '13 at 15:56
  • Find out whether sharing the same front end contributes to your problem. Give two users their own copies. Do those 2 users experiences the same problems when they are the only ones using the application? – HansUp Jan 10 '13 at 15:58
  • I'm currently having trouble recreating the problems. This problem was reported to me last night, but since I've been in the office all morning, I (and others) haven't been able to recreate it. There's so many variables to take into account, it's difficult to pinpoint. As of right now, I can log into all databases and use them without trouble. – Scotch Jan 10 '13 at 16:08
  • OK, while you're waiting for the troubles to reappear, have a look at this: http://stackoverflow.com/questions/2204175/how-do-i-distribute-updates-to-a-access-database-front-end – HansUp Jan 10 '13 at 16:37
  • Looks like Fenton's answer to that question might be a good fit if I can't figure out a different solution. So far, the only issues I have with a shared front end is the current problem and that I need to boot everyone out before I can develop (something I already implemented a solution for). An automatic front end updater/distrubutor could be useful. – Scotch Jan 10 '13 at 17:03

1 Answers1

1

I had fits with this issue, trying to have several users share the same front end from a network share. Things would just...not work. Then when I went back it was impossible to dupilcate the failures. I decided to have the application installed on the local machines, but this had version control issues, especially since I had several different front ends running at the same time for different projects. There were updaters out there but they either cost money or I couldnt see the code and didnt trust them. I came up with this as a solution and have been using it since Access 2003.

This is a seperate ACCESS database, you have to lock it down just like you would any front end.

This launcher works for the four access front ends that I am running right now. There are two table that you have to setup on the network.

TABLE NAME: RunTimeTracking

FIELD: RTTID : AutoNumber

FIELD: RTTComputerName : Text

FIELD: RTTLoginTime : Date/Time

TABLE NAME: VersionControlTable

FIELD: VCTID : AutoNumber

FIELD: VCTVersion : Number

FIELD: VCTSourceLoc : Text

FIELD: VCTDest : Text

FIELD: VCTDateVer : Date/Time

The RunTimeTracking table works to prevent the user from starting the actual application without using the launcher. When the launcher runs it inserts a entry into the table with the computer name. When the application runs it looks for that entry, if it doesnt see it. It warns and dumps.

In the version control table put the location of the most up to date app, the location on the local machine where you want the applicaiton to be stored.

If you have more than one program that you are controlling, then increment VCTVersion entry and reference it in your code in the launcher.

strSQL = "SELECT * FROM VersionControlTable WHERE VCTVersion = 200"

When the launcher runs it checks the CREATED datestamp on the local file to the one on the network, if they are different, it copies. If not, it runs.

      Private Sub Form_Load()

        DoCmd.ShowToolbar "Ribbon", acToolbarNo
        DoCmd.ShowToolbar "Status Bar", acToolbarNo


        DoCmd.Maximize


        Form.TimerInterval = 2000


    End Sub




    Private Sub Form_Timer()

        runDataCheck

    End Sub
Private Sub runDataCheck()


' This is the launcher program. This program is designed to check for
' Version information and upload and download the new version automaticaly.

' Place entry into the Run Time Tracking Table. This will be used by the Main Application to verify that
' The application was launched by the Launcher and not run straight from the desktop

'First, retrieve the name of the computer from the Environment.

Dim strCompName As String

strCompName = Environ("computername")


' Now, delete all entries on the tracking table that have this computer name associated with it.
' Later we will try to add a trigger that archives the logins.
Dim strSQL As String

strSQL = "DELETE FROM RunTimeTracking WHERE RTTComputerName = '" & strCompName & "'"


adoSQLexec (strSQL)


' Now, add and entry into the table
strSQL = "INSERT INTO RunTimeTracking (RTTComputerName,RTTLoginTime) VALUES ('" & strCompName & "','" & Now() & "')"
adoSQLexec (strSQL)

' First, retrieve the parameters from the Version Control File and put them into variables that we can use.
Dim strSource As String
Dim strDest As String
Dim dateVer As Date
Dim rs As New ADODB.Recordset

'LBLSplashLabel.Caption = "Checking Version Information...."

strSQL = "SELECT * FROM VersionControlTable WHERE VCTVersion = 200"



     With rs

        rs.Open strSQL, CurrentProject.Connection

     End With

strSource = rs.Fields("VCTSourceLoc").Value
strDest = rs.Fields("VCTDest").Value
dateVer = rs.Fields("VCTDateVer").Value



Set rs = Nothing

' Next. See if the folders on both the local drive and the source drive exists.
Dim binLocal As Boolean
Dim binNet As Boolean
Dim binDirectoryLocal As Boolean

'Debug.Print strSource
' First check to see if the network file exists.
binNet = FileExists(strSource)

If binNet = False Then

    MsgBox ("The network source files are missing. Please contact Maintenance!")
    Application.Quit (acQuitSaveNone)


End If


' Get the timestamp from the network version since it exists.
Dim fileNet As File

Dim fileLocal As File

Dim fileNetObject As New FileSystemObject

Set fileNet = fileNetObject.GetFile(strSource)

Debug.Print strSource

Debug.Print "Created Date : " & fileNet.DateCreated

Dim strDirName As String
Dim intFind As Integer



' Check to see if the Local file Exists.

binLocal = FileExists(strDest)

If binLocal = False Then
    'There is no local file.  Check to see if the directory exists

    ' Get the directory name
    intFind = (InStrRev(strDest, "\", , vbTextCompare))
    strDirName = (Left(strDest, intFind - 1))


    Debug.Print "Directory Name: " & strDirName


     binDirectoryLocal = FolderExists(strDirName)

     If binDirectoryLocal = False Then
        'There is no local directory. Create one
        MkDir (strDirName)

'        LBLSplashLabel.Caption = "Copying Files...."

        'Copy the source file to the directory.
        FileCopy strSource, strDest

        'Since we have no copied the latest version over, no need to continue. Open the main app

    OpenMaintApp (strDest)


     Else
        ' No need to create the directory, simply copy the file.
        'Copy the source file to the directory.
'         LBLSplashLabel.Caption = "Copying Files...."
         FileCopy strSource, strDest

         'Since we have no copied the latest version over, no need to continue. Open the main app

    OpenMaintApp (strDest)


     End If
End If

'Now we know that the file is in the directory, now we need to check its version.

'Get the last modified date from the file.


Set fileLocal = fileNetObject.GetFile(strDest)

Debug.Print "Last Modified Date : " & fileLocal.DateCreated



'Do the version check

If fileLocal.DateCreated <> fileNet.DateCreated Then

'         LBLSplashLabel.Caption = "Copying Files...."
         'Copy the source file to the directory.
         FileCopy strSource, strDest

         'Since we have no copied the latest version over, no need to continue. Open the main app

    OpenMaintApp (strDest)

Else

    OpenMaintApp (strDest)
End If




    OpenMaintApp (strDest)





End Sub
Private Sub OpenMaintApp(strAppName As String)
Dim accapp As Access.Application

Set accapp = New Access.Application

accapp.OpenCurrentDatabase (strAppName)

accapp.Visible = True

DoCmd.Quit acQuitSaveNone



End Sub
Kassabba
  • 340
  • 4
  • 15
  • This seems like a cool solution, and is similar to something I was thinking of implementing (a launcher). I think I'll use something like this. – Scotch Feb 11 '13 at 20:04