PC Review


Reply
Thread Tools Rate Thread

Current Security Group

 
 
JF Bouthillier
Guest
Posts: n/a
 
      6th Jul 2004
Hi all,

I was wondering if there was an easy way to know the
security group of current user.

I know that CurrentUser returns the user but how do I
know his group?

Thank you so much.
JF
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      6th Jul 2004
"JF Bouthillier" <(E-Mail Removed)> wrote in message
news:2811e01c4637f$d0da9980$(E-Mail Removed)
> Hi all,
>
> I was wondering if there was an easy way to know the
> security group of current user.
>
> I know that CurrentUser returns the user but how do I
> know his group?


A user can belong to multiple groups, so you can't just ask, "What group
does this user belong to?" You could conceivably ask for some sort of
list or array of groups, but most often what you want to know is, "Does
the current user belong to group X?". For that you can use a function
like this:

'----- start of code -----
Function fncUserIsInGroup(GroupName As String) As Boolean

' Returns True if the current user is a member of the specified
' security group; False if not, or if the group doesn't exist, or
' if an error occurs reading the groups.

Dim ws As Workspace

Set ws = DBEngine.Workspaces(0)

On Error Resume Next
fncUserIsInGroup = _
(ws.Users(CurrentUser).Groups(GroupName).Name = GroupName)

Set ws = Nothing

End Function
'----- end of code -----


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
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
Find current Security Group of current user Deano Microsoft Access Form Coding 2 25th Nov 2004 09:08 AM
Finding the current security group John Baker Microsoft Access Security 1 18th Aug 2004 01:54 PM
finding the current security group John Baker Microsoft Access Security 0 18th Aug 2004 05:15 AM
Using VBA to identify the current users security group April Microsoft Access Security 0 15th Sep 2003 07:04 PM
Re: Using VBA to identify the current users security group TC Microsoft Access Security 0 11th Sep 2003 03:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:50 AM.