Add a new user : User Account « Access « VBA / Excel / Access / Word






Add a new user

 
Sub UserAdd()

    Dim mySpace As Workspace
    Dim usrMark As User
    Dim strUsersPID As String

    Set mySpace = DBEngine(0)
    strUsersPID = "1234abcd"
    Set usrMark = mySpace.CreateUser("Mark")
    usrMark.Password = "Doc"
    usrMark.PID = strUsersPID
    mySpace.Users.Append usrMark
End Sub

 








Related examples in the same category

1.Enumerate group and users
2.Creating a User Account
3.Deleting a User Account
4.Listing All User Accounts
5.Retrieving the Name of the Object Owner
6.Setting User Permissions for an Object
7.Creating a User Account with SQL command
8.Changing a User Password with SQL command
9.Setting User Permissions for a Database
10.Setting User Permissions for Containers
11.Checking Permissions for a Specific Object