PC Review


Reply
Thread Tools Rate Thread

Adding users to work Group file with the help of code

 
 
Ashutosh
Guest
Posts: n/a
 
      11th Jul 2003

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
 
Reply With Quote
 
 
 
 
Graham Mandeno
Guest
Posts: n/a
 
      14th Jul 2003
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



 
Reply With Quote
 
Leif
Guest
Posts: n/a
 
      14th Jul 2003
Note that in my experience you may add a user to a group,
and if you check via the User and Group Accounts... dialog
it will show them as added, but if they are currently
logged in they will not have the group permissions. They
must first log out and back in again.

Leif
>-----Original Message-----
>
>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
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Users group to .mdb file permissions =?Utf-8?B?YWZyb2c0dTI=?= Windows XP WMI 0 1st Aug 2007 07:20 PM
GPO - adding Domain Users to local Power Users group JohnB Microsoft Windows 2000 Active Directory 3 14th Oct 2004 03:21 PM
Adding Domain Users group to local Power Users JohnB Microsoft Windows 2000 Active Directory 1 1st Sep 2004 08:57 PM
Adding users to a group Massimo Microsoft Windows 2000 Group Policy 10 20th Apr 2004 06:16 PM
Adding Domain Users Global Group to Power Users localgroup Phill H. Microsoft Windows 2000 1 24th Jul 2003 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 AM.