views:

1359

answers:

1

I'm having trouble in creating a one-to-one relationship between two tables in MS Access - when I create the relationship, it defaults to "Many-to-one", and I don't see an option to change it. Is there a way to do this?

+2  A: 

Access has no such concept. You can either conflate the two tables into one, or place unique indexes on both tables for the common field(s). Are there other benefits you would expect?

You could I suppose create FK relationships in both directions, but I'm not sure what it would gain you except maybe query hints.


EDIT: Important update note from comment -

I don't see the problem. I opened a random DB on my computer, duplicated a table, and opened the Relationships editor. Dragged one ID field to another to create a relationship. http://i43.tinypic.com/2v30x7c.png One-to-one is an option. – Brendan Kidwell

le dorfier
I don't see the problem. I opened a random DB on my computer, duplicated a table, and opened the Relationships editor. Dragged one ID field to another to create a relationship. http://i43.tinypic.com/2v30x7c.png One-to-one is an option.
Brendan Kidwell
Good info, thx - added comment above.
le dorfier
What do you mean by "Access has no such concept?" Sure, Jet is the actual database engine, but nobody distinguishes the two. Jet certainly allows the creation of a 1:1 relationship as long as the joined fields both have unique indexes and are compatible data types.
David-W-Fenton
BTW, there are perfectly valid reasons to partition a table into separate 1:1 tables, e.g., supertype/subtype relationships, or, to move complex data types (memos, BLOBs, OLE) into another table to protect the main table from any corruption of the pointers that are stored for those data types.
David-W-Fenton
Yup, that's why I asked about what benefits were expected.
le dorfier
Yes, I didn't have a unique index on one of the fields. Making it so caused it to have a one-to-one relationship type.
Smashery