Whos accessing my database

shamas21

Registered User.
Local time
Today, 19:40
Joined
May 27, 2008
Messages
162
Hi All

I have a database that i located on a shared drive. Is there a way of telling who is accessing the database in any one go? i.e. a hidden system table that tells me this?

Im trying to populate my treeview control with users who are accessing the database. Any help is welcome.

Thanks
 
have you checked the samples - i am sure there is something on this - not sure what it is called though-

you would be better off with a log in system though
 
have you checked the samples - i am sure there is something on this - not sure what it is called though-

you would be better off with a log in system though


Hi Gary

What do you mean by samples?
 
I have just posted a sample database that does just that. To get it to work from within your current database you will need to import the different objects into your mdb. Alternatively edit the code as suggested and revise the connection.

CodeMaster::cool:
 
I have a logging system in place which also captures the users login and computer details and records when they logged in. These details are held in a 'Usage' table and then when the user closes the Db a 'Logged out' time is also recorded so you can then easily get a list of those users still using the Db.
The following is on the 'On Open' event of the Start up form:

Code:
 DoCmd.SetWarnings False
    Dim oNet, ocomp As Object
    Set oNet = CreateObject("WScript.Network")
    Set ocomp = CreateObject("WScript.Network")
    UserName = oNet.UserName
    computername = ocomp.computername
    If (IsNull(DLast("[LoggedOut]", "Usage", "[UserName] ='" & Me.UserName & "'"))) Then
            If MsgBox("Please remember to close the Database using the 'Exit' button provided." & Chr(13) & Chr(10) & "Thank you for your co-operation.", vbInformation, "Info") = vbOK Then
            End If
    End If
    DoCmd.OpenQuery "qryUpdateUsage", acViewNormal
        If (IsNull(DLookup("[Name]", "Users", "[Login ID] ='" & Me.UserName & "'"))) Then
            Me.Caption = "UNKNOWN USER - Welcome to the Database"
            Me.security = 777
        Else
            Me.Caption = DLookup("[Name]", "Users", "[Login ID] ='" & Me.UserName & "'") & " - Welcome to the Database"
            Me.security = DLookup("[Security]", "Users", "[Login ID] ='" & Me.UserName & "'")
        End If
There is also a little check in place to ensure that users use the available 'Exit' button on the Switchboard so that their 'Logged Out' details are captured each time.
 

Users who are viewing this thread

Back
Top Bottom