473,466 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

tricky problem :-) - self references & direction

I want to model relations between "Groups" and
also annotate the relations!

My solution so far:

Group
- GroupName : Text | PRIMARY_KEY
- Titel : Text
- Info : Memo

Group2Group
- GroupName1 : Text | PRIMARY_KEY
- GroupName2 : Text | PRIMARY_KEY
- Relation : Memo

Now I connect Group.GroupName to Group2Group.GroupName1 and
Group_1.GroupName to Group2Group.GroupName2 !

Problem: I want _only_ one record for _each_ relation and
_not_ for every direction.
(Depends on who is GroupName1 or GroupName2, if
you swap them you get two distinct records, not
one :-(

Thanks for your ideas!

Ciao,
Rittersporn

Nov 13 '05 #1
3 1328
The structure you have works for directional relationships, e.g. where
GroupName1 represents a parent in the relation, and GroupName2 is the child.

If the relation is non-directional (reflex), it might be better to specify
the members of the group as multiple records in the members table, instead
of as multiple repeating fields:

Group
- GroupName : Text | PRIMARY_KEY
- Titel : Text
- Info : Memo

GroupMember
- GroupName : Text | PRIMARY_KEY
- Relation : Memo

It's not a simple situation with a one-size-fits-all answer, but there's a
very flexible structure suggested in this article:
People in households and companies - modelling human relationships
at:
http://allenbrowne.com/AppHuman.html

--
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.

<ri*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want to model relations between "Groups" and
also annotate the relations!

My solution so far:

Group
- GroupName : Text | PRIMARY_KEY
- Titel : Text
- Info : Memo

Group2Group
- GroupName1 : Text | PRIMARY_KEY
- GroupName2 : Text | PRIMARY_KEY
- Relation : Memo

Now I connect Group.GroupName to Group2Group.GroupName1 and
Group_1.GroupName to Group2Group.GroupName2 !

Problem: I want _only_ one record for _each_ relation and
_not_ for every direction.
(Depends on who is GroupName1 or GroupName2, if
you swap them you get two distinct records, not
one :-(

Thanks for your ideas!

Ciao,
Rittersporn

Nov 13 '05 #2
Sorry, that GroupMember tab le should have had the parent group and the
child member:

GroupMember:
ParentGroup Foreign key to Group.GroupName
GroupMember Also foreign key to Group.GroupName

--
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.

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
The structure you have works for directional relationships, e.g. where
GroupName1 represents a parent in the relation, and GroupName2 is the
child.

If the relation is non-directional (reflex), it might be better to specify
the members of the group as multiple records in the members table, instead
of as multiple repeating fields:

Group
- GroupName : Text | PRIMARY_KEY
- Titel : Text
- Info : Memo

GroupMember
- GroupName : Text | PRIMARY_KEY
- Relation : Memo

It's not a simple situation with a one-size-fits-all answer, but there's a
very flexible structure suggested in this article:
People in households and companies - modelling human relationships
at:
http://allenbrowne.com/AppHuman.html

<ri*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want to model relations between "Groups" and
also annotate the relations!

My solution so far:

Group
- GroupName : Text | PRIMARY_KEY
- Titel : Text
- Info : Memo

Group2Group
- GroupName1 : Text | PRIMARY_KEY
- GroupName2 : Text | PRIMARY_KEY
- Relation : Memo

Now I connect Group.GroupName to Group2Group.GroupName1 and
Group_1.GroupName to Group2Group.GroupName2 !

Problem: I want _only_ one record for _each_ relation and
_not_ for every direction.
(Depends on who is GroupName1 or GroupName2, if
you swap them you get two distinct records, not
one :-(

Thanks for your ideas!

Ciao,
Rittersporn

Nov 13 '05 #3
Hi Allen

thank you very much for your help. I still use
a typical m:n mapping.

i) As a convention I assign GroupName1 the "smaller"
value. Well, I compare Name1 < Name2 and swap
if necessary before assignment.

This is just to prevent "double" entries.

ii) To fill a subform with the relations I use:

SELECT GroupName2,Comment FROM tblGroup2Group
WHERE GroupName1="The xyz Group"
UNION SELECT GroupName1,Comment FROM tblGroup2Group
WHERE GroupName2="The xyz Group";

So basically I can do want I want, I just have
to use some more Visual Basic "magic" instead
of (just) the wizard to fill out forms and insert
or delete entries.

The creation of "meta"-tables or defining relations
as table entries leads to madness ;-)

Ciao,
Rittersporn

Nov 13 '05 #4

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

Similar topics

15
by: Ralf W. Grosse-Kunstleve | last post by:
****************************************************************************** This posting is also available in HTML format: http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html...
1
by: Andy Dingley | last post by:
Is there a (preferably formally defined) name for the set of characters that must be represented in XML by their entity references ? i.e. &amp;, &lt; etc. ? I'm writing documentation at present and I...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
25
by: PyPK | last post by:
What possible tricky areas/questions could be asked in Python based Technical Interviews?
13
by: Steve Jorgensen | last post by:
== On Error Resume next, and Err.Number == If you want to call one of your procedures from another procedure, and check for errors afterward, you mayimagine that you should write code something...
3
by: Ed Sutton | last post by:
My solution contains multiple C# and C++ components as well as a deployment project. In my top-level C# WinForms application, I added references to some components by browsing to the...
14
by: felixnielsen | last post by:
Consider this 3d vector: const SIZE = 'some_size'; std::vector<std::vector<std::vector<char> > >GRID(SIZE, std::vector<std::vector<char> >(SIZE, std::vector<char>(SIZE))); It can be viewed...
24
by: Peter Maas | last post by:
The Python FAQ 1.4.5 gives 3 reasons for explicit self (condensed version): 1. Instance variables can be easily distinguished from local variables. 2. A method from a particular class can be...
6
by: Adrian Hawryluk | last post by:
Does anyone know of a way to manipulate a macro list to remove either the beginning or the end element? I.e. Given: #define ELEMENTS EL(1) EL(2) EL(3) Is there any manipulation to get just...
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
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,...
0
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...
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...
1
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.