Creating a User Account with SQL command : User Account « Access « VBA / Excel / Access / Word






Creating a User Account with SQL command

 
Sub CreateUserAccount()
    Dim conn As ADODB.Connection

    On Error GoTo ErrorHandler

    Set conn = CurrentProject.Connection

    conn.Execute "CREATE USER yourName yourpass 0302"
ExitHere:
    If Not conn Is Nothing Then
        If conn.State = adStateOpen Then conn.Close
    End If
    Set conn = Nothing
    Exit Sub
ErrorHandler:
    Debug.Print Err.Number & ":" & Err.Description
    Resume ExitHere
End Sub

 








Related examples in the same category

1.Enumerate group and users
2.Add a new user
3.Creating a User Account
4.Deleting a User Account
5.Listing All User Accounts
6.Retrieving the Name of the Object Owner
7.Setting User Permissions for an Object
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