Access中的联接多表问题 [英] Problem with join multi table in Access

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

问题描述

您好所有访客
我在访问时遇到问题.
我尝试在Access中显示3个表中的数据.
这是我的代码,然后我使用

Hi all visitors
i have problem with access.
i try to display data from 3 tables in access.
this is my code and then i use

dim s as string
dim rd as DAO.recordset
s="select T0.ID,T0.StudentID,T1.StudentName from Student T0 join Register T1 on T0.StudentID=T1.StudentID"
set rd=currentDB.OpenRecordSet(s,dbOpenDynaset)


当我运行此代码时,它将出现错误运行时错误"3131"".

但这代码没问题


when i run this code, it will error "Run-time Error ''3131''".

but this code is ok

dim s as string
s="select T0.studentid,T0.studentname from student T0"
set rd=currentDB.OpenRecordSet(s,dbOpenDynaset)


我很伤心,为什么我不能在Access女士中加入多个表?

谢谢


i wounder why i can''t join with multiple tables in Ms Access?

Thanks

推荐答案

在此页面上,他们称其为INNER JOIN:^ ].
我仍然从MS Access中了解到的一点是,您可能必须通过AS引入table alias.

示例:
It seems on this page they call it INNER JOIN: http://office.microsoft.com/en-us/access-help/join-tables-and-queries-HA010096320.aspx[^].
And the little I still know from MS Access is that you probably have to introduce the table alias via AS.

Example:
SELECT st.ID, st.StudentID, reg.StudentName 
FROM Student AS st INNER JOIN Register AS reg ON st.StudentID = reg.StudentID


干杯!

—MRB


Cheers!

—MRB


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

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