Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Security - Who is logged in? (Access 97)

    Is there a way to tell who is currently logged into the database? I have activated the Access Security and generated all the accounts. I want to find out who is using the database. I know that the network can tell me through the network end but is there a way in access?

    Deborah

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Security - Who is logged in? (Access 97)

    Check out the Microsoft Knowledge Base article 186304 - ACC97: How to Read .LDB Files. I think it will give you the idea as to what you need to do for Access 97 - Access 2000 is done rather differently. It does involve a .dll and some VBA, so if that has you concerned, post back.
    Wendell

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    With Jet security, (the security model Access uses)

    CurrentUser() will give you the login name of the person that is logged into that particular seccion.

    If you have an unsecured DB this will always return 'Admin'
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    Perhaps this attachment will help.
    It shows Users and pc name

    I'm sorry but its in A2000, I'm sure some other user will convert it to A97 for you and repost it.
    Just import the form into your database and it will do the trick.
    Attached Files Attached Files

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    Hi Dave

    If my fe is D:Access2Build.mdb and

    and my be is D:Access2BuildtowBuild_be.mdb

    What code do I need for attached be so I can see who is logged in?

    ' Get Path of current database. Should substitute this code
    ' for an attached table path in a multi-user environment.

    Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
    sPath = dbCurrent.Name
    dbCurrent.Close

    Thanks, John

  6. #6
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    You cannot use just the .ldb file in Access 97, because the .ldb file does not 'delete' inactive users. (It will reuse an unused spot, but it doesn't remove them). InActive users do not get removed until everyone is out of the database, then the .ldb file is removed.

    I wrote a sample 97 db (which works in Access 2000 too, can't test it in XP, since I don't have Access XP/2002). This sample database has two class modules, and a form. The form shows how to use the class modules. The form gives you two list boxes, which display .ldb users, and actual users. You can download this db from my site http://www.wolfwares.com in the Access Section. <font color=blue>Edited by Wendell to activate link 12-Nov-02 21:28 MST</font color=blue>

    Drew (The list shows Access user name and computer name)

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Security - Who is logged in? (Access 97)

    Drew,

    Your sample database runs in AXP. I didn't take the time to figure out exactly what it does, but it does run at least. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    John
    You've lost me.
    What are you asking ?

  9. #9
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    Hi Dave

    Trying to see who is attached to backend database from a frontend database.

    If my front end database is D:Access2Build.mdb with frmLoggedOn and

    and my backend database is D:Access2BuildtowBuild_be.mdb

    What code do I need to see who is attached backend database so I can see who is logged in?

    In frmLoggedOn you say

    ' Get Path of current database. Should substitute this code
    ' for an attached table path in a multi-user environment.

    Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
    sPath = dbCurrent.Name
    dbCurrent.Close

    Thanks, John

  10. #10
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    John.
    Try the following.
    I tested it on my FE and it worked ok.
    Let me know how you go on.
    <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>


    Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
    sPath = ("D:Access2BuildtowBuild_be.ldb")
    dbCurrent.Close

  11. #11
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    How do you know it works, if you didn't see what it does? <VBG>

  12. #12
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Security - Who is logged in? (Access 97)

    It opens and runs and I can see a user. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  13. #13
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    Hi Dave

    Your suggestion works fine.

    Is there a way of dynamically getting path of backend db without hard coding?

    Thanks, John

    Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
    sPath = ("D:Access2BuildtowBuild_be.ldb")
    dbCurrent.Close

    PS: In the above situation, do I really need the following two statements?

    Set dbCurrent = DBEngine.Workspaces(0).Databases(0)

    dbCurrent.Close

  14. #14
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Security - Who is logged in? (Access 97)

    John, I should try commenting the lines out to see what happens, you can always de-comment after if something is wrong.

    As for the dynamic question, its perhaps better answered by one of the more learned members.

    My VBA's not that good.

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

    Re: Security - Who is logged in? (Access 97)

    John,

    The Connect property of a linked table (or rather TableDef) contains the path to the database it is in. If you type
    ? CurrentDb.TableDefs("tablename").Connect
    in the Immediate window, you'll get something like
    ;DATABASE=D:Access2BuildtowBuild_be.mdb
    Using string functions like InStr, InStrRev and Mid it should be possible to extract the path from this string.

    Note: if you want a reference to the current database, then CurrentDb is easier than DBEngine.Workspaces(0).Databases(0).

Page 1 of 2 12 LastLast

Posting Permissions

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