T
Tony_VBACoder
In Access 2002, how you can create the PID (Personal ID)
for New User with VBA Code? I am creating a Form where an
Admin can add a New User, but I don't know how to set the
PID for that user, like I can if I use the Security
Form "User and Group Accounts" to add a new user. My
function to add a user is below:
Function CreateUsers(sUserName As String, sPassword As
String) As Boolean
Dim cat As ADOX.Catalog
On Error GoTo CreateUsers_Err
CreateUsers = True
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
' Add User to the Users collection of the Catalog object
cat.Users.Append sUserName, sPassword
CreateUsers_Exit:
Set cat = Nothing
Exit Function
CreateUsers_Err:
MsgBox "Error # " & Err.Number & ": " & Err.Description
CreateUsers = False
Resume CreateUsers_Exit
End Function
for New User with VBA Code? I am creating a Form where an
Admin can add a New User, but I don't know how to set the
PID for that user, like I can if I use the Security
Form "User and Group Accounts" to add a new user. My
function to add a user is below:
Function CreateUsers(sUserName As String, sPassword As
String) As Boolean
Dim cat As ADOX.Catalog
On Error GoTo CreateUsers_Err
CreateUsers = True
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
' Add User to the Users collection of the Catalog object
cat.Users.Append sUserName, sPassword
CreateUsers_Exit:
Set cat = Nothing
Exit Function
CreateUsers_Err:
MsgBox "Error # " & Err.Number & ": " & Err.Description
CreateUsers = False
Resume CreateUsers_Exit
End Function