English 中文(简体)
组合主密钥串联
原标题:Composite Primary Key Cascading

两个字段,大楼和房间, 组成一个独特的主组合键 在我的房间桌子。 关键验证和保存等 。

我有一个 BLANK 对象表,该表有三个字段,使它具有独特性(又是一个复合主键)。

ROOM TABLE
[Building]     [Room]
01             101A
01             102
02             101A

OBJECT TABLE
[Building]     [Room]     [Number]
01             101A       1
01             101A       2
01             102        1
02             101A       1

如何强制实施优惠完整性? 在编辑 MS Access 关系工具中的关系时, 我得到以下错误 : < code> 没有为主表 < / code > 引用域找到唯一的索引 。 我知道( 通过尝试非独有的值) 主表( 对象) 的组合键是正确的 。 我在做什么错? 我如何建立合适的关系并保持完整性( 更新将是一个艰巨的挑战 )?

最佳回答

您需要设置 您的钥匙像这样:

"https://i.sstatic.net/tVFrZ.png" alt="复合密钥"/ >

请注意,会议室的主要密钥设于大楼+房间,物品的密钥设于大楼+房间+ Numb(数字是AFAIR保留词)

问题回答

暂无回答




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

access query to filter and combine count

i have two access tables tableA num count 1 7 2 8 3 9 4 9 5 13 6 6 tableB num count 0 1 1 14 2 12 3 5 4 5 5 11 6 5 how can i create an access query that ...

How to show File Picker dialog in Access 2007?

I want to show a dialog where the user can pick a file, click OK, and then the path to the file will be saved in the database. I have just one problem, I can t figure out how tho show the dialog ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

Returning row number on MS Access

I have 4 tables, from which i select data with help of joins in select query...I want a serial no.(row number) per record as they are fetched. first fetched record should be 1, next 2 and so on... In ...

热门标签