
Signature
Joan Wild
Microsoft Access MVP
Hm! - am I doing something obsurdly stupid?
This all works until
.Groups("Users").Users.Append UsrNew
=======================
With WkSpace
Set UsrNew = .CreateUser("aNewUser", "123456", "Pwd")
.Users.Append UsrNew
.Users.Refresh
.Groups.Refresh
.Groups("Users").Users.Refresh
Set UsrNew = .Users("aNewUser")
MsgBox UsrNew.Name & " - " & .Groups("Users").Name
.Groups("Users").Users.Append UsrNew
'AHHHH - Error
'Err 3219 - Invalid operation
'Mystified
End with
========================
> You need to refresh the Users collection after appending the user (and also
> the groups after creating the group)
[quoted text clipped - 77 lines]
> >> Tel: 01225 765 541
> >> Mobile: 07919 283 968
Joan Wild - 04 Oct 2004 19:00 GMT
Dim wrk As Workspace
Dim usrNew As User
Dim grp As Group
Set wrk = DBEngine.Workspaces(0)
'Create new group
Set grp = wrk.CreateGroup("MyGroup", "12345")
wrk.Groups.Append grp
'Create new user
Set usrNew = wrk.CreateUser("SomeUser", "98766", "SomePassword")
wrk.Users.Append usrNew
'Add user to Users and MyGroup groups
wrk.Groups.Refresh
wrk.Users.Refresh
usrNew.Groups.Append wrk.CreateGroup("Users")
usrNew.Groups.Append wrk.CreateGroup("MyGroup")
> Hm! - am I doing something obsurdly stupid?
> This all works until
[quoted text clipped - 13 lines]
> 'Mystified
> End with

Signature
Joan Wild
Microsoft Access MVP
Jim Bunton - 05 Oct 2004 12:52 GMT
Thanks for persisting Joan.
I now see the error of my ways -
confused by having to use syntax that inferred the creation of a Group that
already existed.
All now working fine - thanks again
> Dim wrk As Workspace
> Dim usrNew As User
[quoted text clipped - 34 lines]
> > 'Mystified
> > End with