Adding Users from VBA

Brian1960

Brian1960
Local time
Today, 21:49
Joined
Aug 13, 2004
Messages
141
I am trying to add new users using code so that the internal Access tables match my own Users table (tblUsers). I use the tblUsers to hold Job Title, Fullname, Tel no etc and use this in reports and merges.

The code I use is...

Set adoUser = New ADOX.User
adoUser.Name = sUserID
If Not sPassword = "" Then
adoUser.ChangePassword "", sPassword
End If
adoCat.Users.Append adoUser
adoUser.Groups.Append "Users"
adoUser.Groups.Append "Admins"

but it fails at the Append bit.

The Err.Description is
"Object or provider is not capable of performing requested operation."
but I can't see anything wrong with the code.

Any thoughts.
 

Users who are viewing this thread

Back
Top Bottom