What is wrong with this query SQL ?

  • Thread starter Thread starter Mota
  • Start date Start date
M

Mota

Hi;
All tables in a BackEnd DB in "E:\MyDataBase\DepotDB.mdb" are available to
my program,but when i want to inner join to one of them,an error occures.The
SQL property of the query that when i open this error ocures (error in from
clause),is so:

Select Table1.*,Table2.dNu from Table1 inner join Table2 in
'E:\MyDatabase\DepotDB.mdb' on Table1.did=Table2.Code

Seems that using a foreign DB in join clause causes this error.What is wrong
here and how i can join to a table in another DB,rather than importing or
linking to it?
Thank you in advance for your help.
 
Mota said:
Hi;
All tables in a BackEnd DB in "E:\MyDataBase\DepotDB.mdb" are available to
my program,but when i want to inner join to one of them,an error occures.The
SQL property of the query that when i open this error ocures (error in from
clause),is so:

Select Table1.*,Table2.dNu from Table1 inner join Table2 in
'E:\MyDatabase\DepotDB.mdb' on Table1.did=Table2.Code

Seems that using a foreign DB in join clause causes this error.What is wrong
here and how i can join to a table in another DB,rather than importing or
linking to it?


This is probably my fault since I think your syntax should
work, but I just tried it and Access does object to the use
of IN in a JOIN.

An alternative syntax that worked for me in a JOIN:

Select Table1.*,Table2.dNu
FROM Table1 INNER JOIN [E:\MyDatabase\DepotDB.mdb].table2
ON Table1.did=Table2.Code
 
Yeah;
I got this from ur answer to my post about linking to a table in another
DB,but it didnt work,unfortunately.I thank you for that help,and this
one,too.The last one works fine for me.
THX.

Marshall Barton said:
Mota said:
Hi;
All tables in a BackEnd DB in "E:\MyDataBase\DepotDB.mdb" are available to
my program,but when i want to inner join to one of them,an error occures.The
SQL property of the query that when i open this error ocures (error in from
clause),is so:

Select Table1.*,Table2.dNu from Table1 inner join Table2 in
'E:\MyDatabase\DepotDB.mdb' on Table1.did=Table2.Code

Seems that using a foreign DB in join clause causes this error.What is wrong
here and how i can join to a table in another DB,rather than importing or
linking to it?


This is probably my fault since I think your syntax should
work, but I just tried it and Access does object to the use
of IN in a JOIN.

An alternative syntax that worked for me in a JOIN:

Select Table1.*,Table2.dNu
FROM Table1 INNER JOIN [E:\MyDatabase\DepotDB.mdb].table2
ON Table1.did=Table2.Code
 
Back
Top