Views not executing in access project

  • hi

    in another post i have called 'Altered views not executing in access project'

    someone very kindly answered by question of how to refresh the the connection between the back end sql server and the front end project in VBA. the answer is as follows:

    Dim tmpConnectionString As String

    tmpConnectionString = CurrentProject.BaseConnectionString

    CurrentProject.CloseConnection

    CurrentProject.OpenConnection (tmpConnectionString)

    this works fine only if one person is logged into the project. does anyone know a way round this other than for every user to create there own copy of the adp?

    thanks

    Pete

  • Multiple users of one adp is not a good idea anyway - performance will be greatly reduced and you will have lots of concurrency problems like the ones you are experiencing.

    If the users are not developers, build the project as a compiled ade project and give each user a copy of this to be held locally on their PC.

    To prevent users working with old versions of a frontend, build a version number into the code and hold the current version number of the front end in a table in the backend database. In the startup macro or screen, compare the FE version with the BE version, and if they don't match, prevent the application from running.

    I use code like this:

    Option Explicit

    Public Const CurrentVersion = "5.36c"

    Public Function CheckVersion() As Boolean

    On Error GoTo err_handler

    Dim dbVer As String

    dbVer = Nz(DLookup("CurrentVersion", "tblSystemData"), "")

    If dbVer <> CurrentVersion Then

    MsgBox "Invalid Program Version - please check your email or contact Support" & vbCrLf & "FE v " & CurrentVersion & vbCrLf & "BE v " & dbVer, vbCritical + vbOKOnly, "Invalid Version"

    Application.Quit

    Else

    CheckVersion = True

    End If

    exit_handler:

    Exit Function

    err_handler:

    MsgBox "(" & Err.Number & ")" _

    & vbNewLine & vbNewLine & Err.Description, vbOKOnly + vbInformation, "Version Number Error"

    Resume exit_handler

    End Function

    I roll new versions out using a simple batch file - I send a link to the batch file to all users, then change the current version number in the back end - this stops the old versions working, and they have to click on the link in the email to get the new version installed - these are held in a directory hierarchy on the server, as is the batch file.

    The batch files I use are like this:

    @Echo off

    Echo Now Installing GE Money v2.05

    if Exist "C:\Access Systems\GEMoney.ade" copy "\\audit4\ciapps\Access Systems\GE Money\v2.05\GEMoney.ade" "C:\Access Systems\GEMoney.ade" >nul:

    Echo v2.05 Installation Completed

    pause

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply