Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2002
    Posts
    3

    Unanswered: How can I get a user name that's locked a table?

    I have an NT-networked Access database where I frequently have to make changes to the data tables. However, often the table is locked and I'll receive the following typical message:

    "Couldn't lock 'tablename'; currently in use by 'Admin' on machine 'machinename'."

    The application doesn't utilize MS Access security, so every Access user name = Admin. The machine name is cryptic so I can't identify the user intuitively from that and I don't want to keep calling the company's network support area to identify the user logged onto a particular machine.

    Does anybody have code or a function where I can get the network user ID if I have the machine name? I'm sure there's a way to manipulate the Windows API to get this data, I just haven't figured out how. I'm searching, but can't find it.

    Thanks,

    Rick

  2. #2
    Join Date
    Mar 2002
    Location
    Sacramento, CA
    Posts
    120

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    Try the GetUserName API.

  4. #4
    Join Date
    Apr 2002
    Posts
    3

    Re: From Dev

    Originally posted by mrabrams
    http://www.mvps.org/access/api/api0008.htm

    Michael
    Thanks, but unfortunately this function returns the network user name of the local machine where the function is called. In other words, my user name is returned when I run it.

    I need to retrieve the user name of the network machine which has opened up the .MDB file and is currently locking the table.

    If there is a function that can return a network user name when supplying a machine name as an argument, that would be helpful as well.

    Thanks,

    Rick

  5. #5
    Join Date
    Mar 2002
    Location
    Sacramento, CA
    Posts
    120

    mskb

    http://support.microsoft.com/default...;en-us;Q176670

    scroll down and download the jetutils.exe

    Michael

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    If you still need to find the user programmatically instead of using the jetutils.exe - see the following example:

    example

Posting Permissions

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