1

In Access in all the locking files, and notifications that a file can do x because a user is locking the file it only gives the name Admin.

How do I change that name?

I have a database that is used by over 40 users all that are using Hot Desks so I can have 40 users listed as "Admin" with computer names that have as much meaning as SDF2134.

I know how to add a user and all of that in vba using CREATE USER but how do I make that the primary user and/or change the Admin user name so it has meaning.

I understand that user security has been removed from Access, but there is still legacy stuff like this that make my problem hard to fix.

Bullfrog
  • 207
  • 4
  • 16
  • As a workaround, I RDP to the computer name listed, which advises me that domain/user is currently logged on. That gives me the actual username of the person in the DB, and I can email them to ask them to exit. However that won't massively help if you have 40+ users... – Dave May 17 '16 at 12:50
  • @Dave And IT Security has blocked all of that sort access – Bullfrog May 17 '16 at 12:55
  • Well that's unhelpful of them... Don't suppose `WMIC /Node:remotecomputer ComputerSystem Get UserName` on the commandline would run and tell you who was on the relevant PC? – Dave May 17 '16 at 13:01

1 Answers1

1

This requires some work and maintenance (keeping the users list up to date), and I wonder if it's worth the effort.

You need to create a workgroup file (system.mdw), see How to use the Workgroup Administrator utility in Access 2007

Start your database using this mdw: How to use an .mdw file in Access 2010

Then create all users with CREATE USER. They will be stored in your mdw file.

And finally, all users must start the database using the mdw too, and setting their username. So their command-line could look like this:

"%ProgramFiles(x86)%\Microsoft Office\Office14\MSACCESS.EXE" 
  C:\path\frontend.accdb /wrkgrp N:\networkpath\your_system.mdw /User %username%

%username% saves you from giving each user their personal command-line.

If you want to verify that a user hasn't tampered with it, you can check in VBA:

If CurrentUser() <> CreateObject("WScript.Network").UserName Then
    MsgBox "Want to be somebody else?"
End If

CurrentUser() gives the /User parameter, the other method the Windows login.


Well, I think this might work. I only ever have used mdw files with mdb/mde databases.

Community
  • 1
  • 1
Andre
  • 26,751
  • 7
  • 36
  • 80
  • 1
    I understand that it may not be worth the effort, but your answer works exactly as advertised, thank you – Bullfrog May 18 '16 at 03:02