The information in this article applies to:
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
When you start Microsoft Access version 2.0, you may receive the following
error message:
No permission for '<path>\UTILITY.MDA'
This article assumes that you are familiar with Access Basic and with
creating Microsoft Access applications using the programming tools provided
with Microsoft Access. For more information about Access Basic, please
refer to the "Building Applications" manual.
CAUSE
You have run an Access Basic procedure that removed the Admin user from
both the Admins and Users group. Note that if you try to do this through
the user interface instead of through code, you receive the following error
message:
Can't remove user from group 'Users.'
RESOLUTION
Quit Microsoft Access. In Windows Explorer or Windows File Manager, copy
the current System.mda file into System.old. Then run Wrkgadm.exe and
create a new System.mda file. You should now be able to start Microsoft
Access.
To prevent this problem from occurring, follow these steps:
- Start Microsoft Access and open any database.
- On the Security menu, click Change Password. Assign a password to the
Admin user account. The following procedure assumes that you have
changed the Admin user's password to "password" (without the quotation
marks).
- Create a new module and type the following procedure:
Sub sectest ()
Dim ws As WorkSpace
Dim usr As User
Dim grp As Group
On Error GoTo Errorhandler
Set ws = dbengine.CreateWorkspace("", "admin", "password")
' Create user NewAdmin and add to Admins group.
Set usr = ws.CreateUser("NewAdmin", "xxx555", "identify")
ws.users.Append usr
usr.groups.Append ws.CreateGroup("admins")
' Remove Admin from Admins, Users group.
ws.groups("users").users.Delete "admin"
ws.groups("admins").users.Delete "admin"
' Log on again and add NewAdmin to Users group.
ws.Close
Set ws = dbengine.CreateWorkspace("", "NewAdmin", "identify")
Set usr = ws.users("NewAdmin")
usr.groups.Append ws.CreateGroup("users")
Exit_sectest:
Exit sub
Errorhandler:
Msgbox CStr(Err) & " " & Error(Err)
Resume Exit_sectest
End Sub
- Run this procedure and quit Microsoft Access.
- Restart Microsoft Access; enter "NewAdmin" as the log on name and
"identify" as the log on password.
MORE INFORMATION
Steps to Reproduce Behavior
- In Windows Explorer or Windows File Manager, copy the current System.mda
file into System.bak.
- Start Microsoft Access and open a new database.
- Open a new module and type the following code:
Sub sectest ()
Dim ws As WorkSpace
Dim usr As User
Dim grp As Group
On Error GoTo Errorhandler
' Create user NewAdmin and add to Admins group.
Set ws = dbengine.CreateWorkspace("", "admin", "")
Set usr = ws.CreateUser("NewAdmin", "xxx555", "identify")
ws.users.Append usr
usr.groups.Append ws.CreateGroup("admins")
' Remove Admin from Admins, Users group.
ws.groups("users").users.Delete "admin"
ws.groups("admins").users.Delete "admin"
ws.Close
Exit_sectest:
Exit sub
Errorhandler:
Msgbox CStr(Err) & " " & Error(Err)
Resume Exit_sectest
End Sub
- Close the database and quit Microsoft Access.
Note that when you attempt to restart Microsoft Access, you receive the
error described in the "Symptoms" section.
REFERENCES
For more information, see Microsoft Access "Building Applications," version
2.0, Chapter 14, "Securing Your Applications," pages 340-344.