MS Access中的一对一关系 [英] One-to-One relationship in MS Access

查看:109
本文介绍了MS Access中的一对一关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MS Access中的两个表之间创建一对一关系时遇到困难 - 当我创建关系时,它默认为多对一,我没有看到一个选项更改。有没有办法这样做?

解决方案

Access没有这样的概念。您可以将两个表合并成一个表,或者在两个表上为公共字段放置唯一索引。还有其他的好处吗?



你可以假设在两个方向创建FK关系,但我不知道它会获得什么,除了可能的查询提示。





编辑:注释中的重要更新说明


< blockquote>

我没看到问题。我在我的电脑上打开了一个随机DB,复制了一张表,并打开了Relationships编辑器。将一个ID字段拖动到另一个ID以创建关系。 http://i43.tinypic.com/2v30x7c.png 一对一是一个选项。 - Brendan Kidwell




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?

解决方案

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

这篇关于MS Access中的一对一关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆