错误Vba,Access,From,Left和Dao一起加入 [英] Error Vba, Access, From ,Left Join with Dao
问题描述
Hi ,
我希望这是一个正确的论坛,询问我的问题,如果没有,抱歉,请移动到正确的位置。
I hope this is a correct forum to ask about my question ,if not ,sorry and please move to correct place.
我的问题是,在我的访问中我有两个表,一个在内存中,另一个在外部。我想在第二张表中选择我想念的所有列。问题出在我的选择中,我不知道如何,但我在From或左连接中发现错误..
My problem, is that in my access i have two tables ,one in memory ,and another external. I want to select all colums that i miss in the second table. The problem is in my select, i don't know how ,but i recive a error from in the From or in the Left Join..
我有什么这是......
What i have is this...
---------------------------- -
------------------------------
Dim db   作为DAO.Database
Dim rs   作为DAO.Recordset
Dim instruccion As String
'这个工作正常,我看了一个具有两者联合的表
instruccion =" SELECT * from tabla1 as t1 UNION SELECT * FROM" &安培; "[MS Access; PWD = databasePWD; DATABASE =" &安培; strpath& "]。tabla1 as t2" b
'但是这一个没有...&bbsp; b $ b指示来自tabla1的SELECT * t1 LEFT JOIN SELECT * FROM" &安培; "[MS Access; PWD = databasePWD; DATABASE =" &安培; strpath& "]。tabla1 as t2 ON tabla1.TEL_NUM_FACTURA = t2.TEL_NUM_FACTURA WHERE((t2.TEL_NUM_FACTURA)为空)< b
设置db = CurrentDb()
设置rs = db.OpenRecordset(instruccion,dbOpenSnapshot)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim instruccion As String
' this works ok ,i recive a table with union of both
instruccion = "SELECT * from tabla1 as t1 UNION SELECT * FROM " & "[MS Access;PWD=databasePWD;DATABASE=" & strpath & "].tabla1 as t2"
' but this one no..
instruccion = "SELECT * from tabla1 as t1 LEFT JOIN SELECT * FROM " & "[MS Access;PWD=databasePWD;DATABASE=" & strpath & "].tabla1 as t2 ON tabla1.TEL_NUM_FACTURA = t2.TEL_NUM_FACTURA WHERE ((t2.TEL_NUM_FACTURA) Is Null)"
Set db = CurrentDb()
Set rs = db.OpenRecordset(instruccion, dbOpenSnapshot)
--------------- -
----------------
有人知道如何解决这个问题吗?
b
$ b谢谢大家
Does anybody know how to fix this?
Thanks for all
推荐答案
我希望这是一个正确的论坛来询问我的问题,如果没有,抱歉和请移动到正确的位置。
I hope this is a correct forum to ask about my question ,if not ,sorry and please move to correct place.
我的问题是,在我的访问中我有两个表,一个在内存中,另一个在外部。我想在第二张表中选择我想念的所有列。问题出在我的选择中,我不知道如何,但我从From或左连接中发现错误..
My problem, is that in my access i have two tables ,one in memory ,and another external. I want to select all colums that i miss in the second table. The problem is in my select, i don't know how ,but i recive a error from in the From or in the Left Join..
我所拥有的是......
What i have is this...
------------------------------
------------------------------
Dim db &NBSP; 作为DAO.Database
Dim rs &NBSP; 作为DAO.Recordset
Dim instruccion As String
'这个工作正常,我看了一个具有两者联合的表
instruccion =" SELECT * from tabla1 as t1 UNION SELECT * FROM" &安培; "[MS Access; PWD = databasePWD; DATABASE =" &安培; strpath& "]。tabla1 as t2" b
'但是这一个没有...&bbsp; b $ b指示来自tabla1的SELECT * t1 LEFT JOIN SELECT * FROM" &安培; "[MS Access; PWD = databasePWD; DATABASE =" &安培; strpath& "]。tabla1 as t2 ON tabla1.TEL_NUM_FACTURA = t2.TEL_NUM_FACTURA WHERE((t2.TEL_NUM_FACTURA)为空)< b
设置db = CurrentDb()
设置rs = db.OpenRecordset(instruccion,dbOpenSnapshot)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim instruccion As String
' this works ok ,i recive a table with union of both
instruccion = "SELECT * from tabla1 as t1 UNION SELECT * FROM " & "[MS Access;PWD=databasePWD;DATABASE=" & strpath & "].tabla1 as t2"
' but this one no..
instruccion = "SELECT * from tabla1 as t1 LEFT JOIN SELECT * FROM " & "[MS Access;PWD=databasePWD;DATABASE=" & strpath & "].tabla1 as t2 ON tabla1.TEL_NUM_FACTURA = t2.TEL_NUM_FACTURA WHERE ((t2.TEL_NUM_FACTURA) Is Null)"
Set db = CurrentDb()
Set rs = db.OpenRecordset(instruccion, dbOpenSnapshot)
----------------
----------------
有人知道如何解决这个问题吗?
b
b $ b b谢谢所有
Does anybody know how to fix this?
Thanks for all
这篇关于错误Vba,Access,From,Left和Dao一起加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!