Prevent Multiple instance of Access 2010 Runtime

sigma788

Registered User.
Local time
Today, 10:16
Joined
Dec 1, 2009
Messages
40
hi all, is it possible to prevent
1- running multiple instance of MSACCESS.exe in runtime
2- running multiple instance of same database in runtime.

After searching,the posts i have found seems not to work on access 2010 runtime.
 
Hmm, if the database is split, as it should be, run the Frontends in Exclusive Mode. Doing that should prevent the Users from opening multiple Frontends on their machines.
 
In my case database is not splitted. so is it possible without splitting.
 
Thanks GinaWhipp for detailed reply.

My runtime database will be used by a single user only.
is it possible in that case to limit running multiple instance of ms access by single user

Regards.
 
Try:

Code:
Function IsRunning() As Integer

'    DoCmd.Maximize
    
 Dim db As DAO.Database
    Set db = CurrentDb()
    
    If IsRunningDDELink(db.Name) Then
        MsgBox "The database is already open"
        Application.Quit
        Set Application = Nothing
    End If

End Function
Code:
Private Function IsRunningDDELink(ByVal strAppName$) As Integer
    
Dim varDDEChannel
    
    On Error Resume Next
    Application.SetOption ("Ignore DDE Requests"), True
    varDDEChannel = DDEInitiate("MSAccess", strAppName)
    
   ' When the app isn't already running this will error
    If Err Then
       IsRunningDDELink = False
    Else
        IsRunningDDELink = True
        DDETerminate varDDEChannel
        DDETerminateAll
    End If
    Application.SetOption ("Ignore DDE Requests"), False
End Function

I have a Form on Startup and put IsRunning in the On Open Event

Simon
 
thanks Simon.
is the code compatible with 2010 or am i doing something wrong.
i am not able to make the code work.

Regards.
 

Users who are viewing this thread

Back
Top Bottom