• Security – Who is logged in? (Access 97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Security – Who is logged in? (Access 97)

    Author
    Topic
    #379311

    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

    Viewing 2 reply threads
    Author
    Replies
    • #631199

      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.

    • #631203

      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’

      • #631211

        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.

        • #631226

          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

          • #631371

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

            • #631475

              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

            • #631483

              John.
              Try the following.
              I tested it on my FE and it worked ok.
              Let me know how you go on.
              groovin

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

            • #631880

              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

            • #631886

              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.

            • #631897

              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).

            • #631969

              Hi Hans

              That got it!

              Thanks

            • #632563

              How can i click on the username and sent him a message on the network .

              THANKS

    • #631255

      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[/url%5D in the Access Section. Edited by Wendell to activate link 12-Nov-02 21:28 MST

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

      • #631336

        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. grin

    Viewing 2 reply threads
    Reply To: Security – Who is logged in? (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: