Results 1 to 10 of 10
  1. #1
    Lounger
    Join Date
    Sep 2006
    Location
    St. Augustine, Florida, USA
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Access Security (2003)

    Is there a way to identify which users in a workgroup are logged on to a Microsoft Office Access database? Also, could the user's id be attached to records that they update?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Security (2003)

    1) See MSKB article How to determine who is logged on to a database by using Microsoft Jet UserRoster in Access 2000 (applies to later versions too).

    2) Yes, like this:
    - Add a text field ModifiedBy to the table.
    - In the form(s) used to enter/edit records from the table, create a Before Update event procedure for the form (or if you already have one, add to it):

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    Me.ModifiedBy = CurrentUser
    End Sub

  3. #3
    Lounger
    Join Date
    Sep 2006
    Location
    St. Augustine, Florida, USA
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Access Security (2003)

    Thanks for your help! Once again you've saved the day!!

  4. #4
    Lounger
    Join Date
    Sep 2006
    Location
    St. Augustine, Florida, USA
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Access Security (2003)

    I have given the Visual Basic code my best shot. I am a novice and not afraid to admit it. I have attached a copy of the code I'm using. My problem is that when I run it I get this message - Cannot start your application. The Workgroup Information file is missing or opened exclusively by another user. Getting this to work is critical so I appreciate your input.
    Attached Files Attached Files

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Security (2003)

    Are you doing this from within the SHC Client.mdb database itself, or from somewhere else?

  6. #6
    Lounger
    Join Date
    Sep 2006
    Location
    St. Augustine, Florida, USA
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Access Security (2003)

    I've tried both. I've tried using the admin login and password. I haven't tried it within the SHC Client.mdb database with the Options=-1 statement at the end. Now that my users are logged on I can't do any modifications. I'll have to wait until morning to try anything new.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Security (2003)

    From within the database, it should be easier because you're already logged in. Here is a simplified version that can be run from within the database:

    Sub ShowUserRosterMultipleUsers()
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset

    On Error GoTo ExitHandler

    Set cn = CurrentProject.Connection

    Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
    , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

    Do While Not rs.EOF
    Debug.Print rs.Fields(0), rs.Fields(1), _
    rs.Fields(2), rs.Fields(3)
    rs.MoveNext
    Loop

    ExitHandler:
    On Error Resume Next
    rs.Close
    Set rs = Nothing
    Set cn = Nothing
    Exit Sub

    ErrHandler:
    MsgBox Err.Description
    Resume ExitHandler
    End Sub

  8. #8
    Lounger
    Join Date
    Sep 2006
    Location
    St. Augustine, Florida, USA
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Access Security (2003)

    Thank you, Hans. I will give it a try tomorrow morning.
    Madeline

  9. #9
    Lounger
    Join Date
    Sep 2006
    Location
    St. Augustine, Florida, USA
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Access Security (2003)

    One more question while I'm thinking about it...What is the significance of the numbers following adSchemaProviderSpecific? Do I need to alter it for my application or is this something specific to VB and just one more thing that I don't understand about it? :-)
    Madeline

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Security (2003)

    You must use the string exactly as provided. It is a constant specific to the Jet provider. Some info is provided in Use ADO to Return a List of Users Connected to a Database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •