473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checking for group membership?

I would like to be able to programatically check for group membership
in an access database. For example, I would like to be able to check
is someone is in the admin group before the program does Y.

something like:

if( current.user.gr oup == admin){
do_something();
}

Thanks in advance friends.

Nov 13 '05 #1
1 4053
Function IsUserInGroup(s trUser As String, strGroup As String) As Boolean
Dim varDummy As Variant
On Error Resume Next
varDummy = DBEngine(0).Use rs(strUser).Gro ups(strGroup).N ame
IsUserInGroup = (Err.Number = 0)
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Karen Hill" <ka**********@y ahoo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I would like to be able to programatically check for group membership
in an access database. For example, I would like to be able to check
is someone is in the admin group before the program does Y.

something like:

if( current.user.gr oup == admin){
do_something();
}

Thanks in advance friends.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8151
by: innesm | last post by:
Hi, Although I havent been able to find any documentation to confirm it, it looks like any change to a windows local group's membership is only reflected in the group editing UI (and the command-line tool 'net localgroup'), and requires a full reboot of windows to take effect for any other applications. Can anyone confirm this, or explain...
3
10771
by: Scott | last post by:
I need to be able to verify group membership in my C# application. All the examples I seem to find show how to query the BUILTIN groups. I need to be able to query the DOMAIN groups. Can I have code examples on how to accomplish this. I tried the following code (in a test Console Application) and all it returns is "DOMAIN\MYUSERNAME...
9
10819
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using LDIFDE as a comparison I get the same results. No members means just that, an empty group. Zero means that the DirectorySearcher.SizeLimit has been...
0
1425
by: Jan Nielsen | last post by:
In ASP.Net I'm trying to check for some users membership of a group. The user is not nessicerily the user requesting the page, and I do not have the users password. So far I've created the following piece code: DirectoryEntry group = new DirectoryEntry(FormatAdsiSyntax(strGroup) + ",group", "domain\\user", "password"); Object q =...
2
1803
by: Fred | last post by:
I need to check if a web client is a member of a domain security group so I can direct them to different aspx web forms for different groups. Thanx in advance.
7
5596
by: Sameh Ahmed | last post by:
Hello there IsInrole gives ya the means to check if the current or impersonated user belongs to a specific windows role or group. is there a way to do the same without using ADSI to check if "domain\user" belongs to "domain\group"? the reason is, when getting the "memberof" property of a user, then checking if it contains the desired group...
17
2661
by: TC | last post by:
In the past I always regarded user/group security as fairly tight. It is tricky to implement, but once implemented properly, it can't be cracked except through a dedicated effort. Recently, however, I saw something which greatly lowered my opinion of user/group security. I sent a secured database to a colleague. I forgot to send him the...
4
1445
by: Paul.Pucciarelli | last post by:
So I have some 'groups' which 'users' can join. There is no enrollment limit on these 'groups'. How should I store the list of users enrolled in the group? I'd like to be able to quickly determine the groups a user is in, and the users in a group. Seems like a common problem but I can't come up with an effecient solution.
1
1635
by: Troels Arvin | last post by:
Hello, Quoting http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/ com.ibm.db2.luw.sql.ref.doc/doc/r0000935.html : Group privileges are not considered for any table or view specified in the CREATE VIEW statement. I discovered this today because a user complained that she couldn't create a simple view referring to a table to...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.