对 Microsoft Access 中的多对多关系进行故障排除?
我创建了一个数据库,其中包含一个 STUDENT 表、一个 COURSE 表和一个名为 STUDENT_COURSE 的交集表。但是,我遇到重复行的问题,并且不知道如何解决它们。
以下是设计视图中的表格和我创建的多对多关系的图片。
http://imgur.com/P7DI1l&THH7A(请务必点击“第二张图片”链接查看关系图片。)
为了简化数据输入,我使用表单向导来设置 SCHEDULE 表单(和子表单)。
如您所见,在表单以及子表单中与该特定学生相关的课程数据。然而,当输入课程子表单数据时,它会创建一个新的 courseID (autoNumber)。这个新的 courseID 会导致重复的 courseNames(请参阅上面的 imgur 链接中的“第二张图片”中的“线性代数”条目),这样当按班级查询时,关联的学生就不会分组在一起。
我的设计有缺陷吗?我是否没有正确使用表格输入数据?请帮我解决这个问题。
非常感谢!
I created a database that holds a STUDENT table, a COURSE table, and an intersection table named STUDENT_COURSE. However, I have problems with duplicated rows and I don't know how to solve them.
Here are pictures of the tables in design view and many-to-many relationship I have created.
http://imgur.com/P7DI1l&THH7A (Be sure to click the "Second Image" link to view the relationships picture.)
In an attempt to simplify data entry, I used the form wizard to set up a SCHEDULE form (and subform).
As you can see, one enters the student data in the form and the course data associated with that specific student in the subform. However, when one enters course subform data, it creates a new courseID (autoNumber). This new courseID results in duplicate courseNames (See "Linear Algebra" entries in above imgur link via "Second Image") so that associated students aren't grouped together when one queries by class.
Is there a flaw in my design? Am I not using the form correctly to enter data? Please help me troubleshoot this.
Thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的子表单应基于 STUDENT_COURSE 表,而不是基于课程一。您仍然可以将课程表中的列添加到子表单中以显示课程相关数据。
以下是一些链接:
Your subform should be based on STUDENT_COURSE table and not on COURSE one. You can still add columns from COURSE table to the subform to display course related data.
Here are some links: