473,394 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Security: Groups Problem

I hope someone can help me with an extrodinarily vexing problem. I've
searched Google high and wide and tried a number of methods for
determining if the current user is part of a specified group in A97. I
can find nothing in the otherwise excellent help files, except examples
of how to add users and specify what groups they are part of and adding
groups.

I have some code below from a post by Allen Browne in 2001 and it won't
work. When I put a break point at the start of the function and run

?IsUserInGroup(access.CurrentUser,"Users")

the code steps to For Each grp and grx and immediately goes straight to
setting the variables to nothing. I am logged into a secured DB as
Developer (member of every group) and I can't figure out what the blink
I'm doing wrong. SImilar things happen with other code snippets.

Please help me. Allen's code fallows.

Function IsUserInGroup(strUser As String, strGroup As String) As Boolean
'Returns True if the user is in the group.
'Example: IsUserInGroup(CurrentUser(), "Admins")
Dim wk As Workspace
Dim grx As Groups
Dim grp As Group
Dim usx As Users
Dim usr As User

Set grx = DBEngine(0).Groups
For Each grp In grx
If grp.NAME = strGroup Then
Set usx = grp.Users
For Each usr In usx
If usr.NAME = strUser Then
IsUserInGroup = True
Exit For
End If
Next
End If
Next

Set usr = Nothing
Set usx = Nothing
Set grp = Nothing
Set grx = Nothing
End Function
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Want some?" - Ditto
Nov 12 '05 #1
1 1868
TC
You do understand that the users & groups are defined in the so-called
workgroup information file (usually wth an MDW extension) - not in the
database file (MDB)?

If you secured the db on your laptop, then took it to work, yo must also
take the workgroup file, >and<, ensure that workgroup file is used when you
open the database. Google on the /wkgrp switch for more information.

HTH,
TC
"Tim Marshall" <tm******@Gunner.Sabot.Spam.On.Loaded.FIRE> wrote in message
news:3F***************@Gunner.Sabot.Spam.On.Loaded .FIRE...
I've been able to isolate what's causing my problem, ie, groups not
being recognized, but don't know why.

The database in question is on my laptop and was secured there. It is a
front end to an Oracle database and presently has Access linked tables,
though my usual approach is to use pass through queries with no linked
tables at all.

When I'm at work on the network, the procs for determining what groups
the user belongs to works fine. When I'm off the network, at home
either connected via phone line (slow connections to the Oracle
database) or off line, it appears the procs, including the one I showed
in the previous post, fail. I tried removing the linked tables, but I
still get the same result.

Any ideas why?
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Want some?" - Ditto

Nov 12 '05 #2

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

Similar topics

11
by: TC | last post by:
Hello All, I have recently had the pleasure of installing Norton Internet Security 2005 and finding that I can no longer create or open a web-based application in Visual Studio .Net. The IDE...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
2
by: TechBoy | last post by:
I am trying to learn on the fly about Access Security for an app we are developing. I realize Access security is an advanced subject with many details. I wanted to share a scenario and ask a...
9
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...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
16
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
1
by: Jason | last post by:
Hi I have a ASP.NET application where i would like to authenticate the connecting users according to the Local Users and Groups on the web server. I have the following code in the ASP.NET...
7
by: nugget | last post by:
Role-based security for an ASP/ASP.NET mixed environment Hello: My co-worker and I have been charged with designing role-based security for our intranet. The technologies we have to work with...
6
by: gfb | last post by:
This was a topic back in 2003 which has now been closed since I get the message "You cannot reply to this topic because it is more than 30 days old or has been closed by a manager." I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...

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.