连接ms-access数据库从1个表到另一个表 [英] connection ms-access database from 1 table to another table
本文介绍了连接ms-access数据库从1个表到另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的,
我通过vb在ms中访问了1个大学表,现在我已经创建了另一个表
学生表我希望无论输入什么数据在大学表中也应该出现在学生表栏中。
Dear all,
I have made 1 college table in ms access through vb,now I have made another table
Of student table I want that whatever data i enter in college table should also appear in student table column.
推荐答案
你不会使用这样的数据库。
表中填充了描述手头实体的行。例如,对于学生,您可以添加关于学生的信息,如姓名等,对于大学,您可以在College表中添加姓名和地址。
表格本身有关系,详细信息表中定义的外键,它们引用主表: http://en.wikipedia.org/wiki/Foreign_key [ ^ ]
现在,当您想要查询两个表中的信息时,可以使用连接: http://en.wikipedia .org / wiki / Sql_join [ ^ ]。例如,对于学生和大学,查询可能类似于:
You don''t use database like that.
Tables are populated with rows describing the entity in hand. For example for a student you add information about the student like name etc and for a college you could add name and address in College table.
The tables themselves have relationships, foreign keys which are defined on the detail table and they reference the master table: http://en.wikipedia.org/wiki/Foreign_key[^]
Now when you want to query information from both tables, you use a join: http://en.wikipedia.org/wiki/Sql_join[^]. For example for students and colleges, the query could be something like:
SELECT *
FROM College c
INNER JOIN Student s
ON s.CollegeId = c.CollegeId
因此数据单独存储在两个表中,但在查询时将它们组合起来。
So the data is stored separately in both tables but when querying you combine them.
这篇关于连接ms-access数据库从1个表到另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文