Access 2007 约束子句中的奇怪错误
Relationship must be on the same number of fields with the same data types. (Error 3368)
The CONSTRAINT clause you are using to create a relationship includes a different number of fields for each table or includes fields with different data types. Check the number of fields in the CONSTRAINT clause, check the data types of fields to make sure they match, and try again.
我以前从未遇到过这个问题。我有两个表,它们之间具有单一的一对多关系。我从一个表到另一个表指定了自己的主键。它们都是相同的数据类型(数字)。如果一个表比另一个表具有更多字段,为什么会很重要?这似乎只有当我分配自己的主键时才会发生。 “许多”表已建立索引(没有重复项)。我已经尝试过“一”表所需的和不需要的。什么给?无论价值如何,没有参照完整性的关系都是允许的。
Relationship must be on the same number of fields with the same data types. (Error 3368)
The CONSTRAINT clause you are using to create a relationship includes a different number of fields for each table or includes fields with different data types. Check the number of fields in the CONSTRAINT clause, check the data types of fields to make sure they match, and try again.
I've never ran into this problem before. I have two tables which have a single one-to-many relationship between them. I designated my own primary key from one table to the other. They are both of the same data type (number). Why should it matter if one table has more fields than another? This only seems to happen when I assign my own primary key. The 'many' table is indexed (no duplicates). And I've tried required and and not required for the 'one' table. What gives? I relationship with no referential integrity is allowed, for whatever that's worth.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
小数和整数不被视为等效的数字类型。您必须将 CountryPK 更改为长整型,或将 CountryFK 更改为小数。您也可以对两者都使用 Double。
Decimals and Integers are not considered equivalent numeric types. You must change either CountryPK to Long Integer or the CountryFK to Decimal. You can also use Double on both.