Hi Ashutosh
To add a new user:
Dim wks as Workspace
Dim usr as User
Set wks = DBEngine(0)
Set usr = wks.CreateUser(<username>, <PID>, <password>)
wks.Users.Append usr
usr.Groups.Append usr.CreateGroup("Users")
Note that this also adds the user to the required "Users" group. To add it
also to another group (assign a role), use:
usr.Groups.Append usr.CreateGroup("AccountsStaff")
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at:
(E-Mail Removed)
Please post new questions or followups to newsgroup.
"Ashutosh" <(E-Mail Removed)> wrote in message
news:08d701c3478c$386df670$(E-Mail Removed)...
>
> Hi Guys,
>
> I have a ms access 97 database and there is a security
> file (workgroup file) which makes the validation for each
> users before letting them access the database.
> Now i want to add users with different roles to this
> security file using a vb code.
> How can this be achieved.
> Also if not vb code then what can be used
>
> Thanks
>
> ashutosh