Need to run a qry"X" from db"A" but from db"B"!*7252008

J

J.Alladien

Dear All,


I Need to run a query "X" from db"A" but it must be done from db"B"!
Is this possible?

Thanks in advance!
 
J

Jeff Boyce

Do an on-line search for "Remote Query".

The general notion goes something like:

SELECT YourField(s) FROM YourTableOrQuery IN 'your database path/name'

You'll have to use the SQL view rather than the query design grid view.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Golfinray

Yes, use the linked table manager and link to the table and query and run it
from B. Or go to file\get external data and link from there.
 
J

J.Alladien

A

Arvin Meyer [MVP]

Even easier, because I already have one of those. This one also uses a Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a "Make-table
Query"
Is that still possible?
Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


J.Alladien said:
Dear All,


I Need to run a query "X" from db"A" but it must be done from db"B"!
Is this possible?

Thanks in advance!
 
J

J.Alladien

Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in Prijscontrole)
,this is input for the table"WINST" which must be found in Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from Catalogus.mdb) in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


Arvin Meyer said:
Even easier, because I already have one of those. This one also uses a Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a "Make-table
Query"
Is that still possible?
Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from db"B"!
Is this possible?

Thanks in advance!
 
A

Arvin Meyer [MVP]

OK Let's try again:

SELECT * INTO NewTableName IN "C:\FullPathTo.mdb"
FROM [C:\FullPathOfOriginal.mdb].TableOrQueryName;

I'm not sure what ARTIKEL=OMZET is, but I am pretty sure that you cannot use
an = sign except in a where clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in Prijscontrole)
,this is input for the table"WINST" which must be found in Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from Catalogus.mdb)
in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


Arvin Meyer said:
Even easier, because I already have one of those. This one also uses a
Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a
"Make-table
Query"
Is that still possible?

Arvin Meyer [MVP]" wrote:

Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from
db"B"!
Is this possible?

Thanks in advance!
 
J

J.Alladien

Arvin,

Yes It worked!!! , only I had to put the tablename in brackets like this:

SELECT * INTO WINST IN 'F:\Voorraad\CATALOGUS.mdb'
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].[VERKOPEN PER ARTIKEL=OMZET];

Thanks a Lot , You guys are great , I would not know what to do without the
community!




Arvin Meyer said:
OK Let's try again:

SELECT * INTO NewTableName IN "C:\FullPathTo.mdb"
FROM [C:\FullPathOfOriginal.mdb].TableOrQueryName;

I'm not sure what ARTIKEL=OMZET is, but I am pretty sure that you cannot use
an = sign except in a where clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in Prijscontrole)
,this is input for the table"WINST" which must be found in Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from Catalogus.mdb)
in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


Arvin Meyer said:
Even easier, because I already have one of those. This one also uses a
Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a
"Make-table
Query"
Is that still possible?

Arvin Meyer [MVP]" wrote:

Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from
db"B"!
Is this possible?

Thanks in advance!
 
J

J.Alladien

Arvin,

Another question, is this remote thing also possible with an "append qry"?
If yes could you send me an example cause I am trying but it's not working
out!

So I have an append QRY "C" in DB"A" and I want to run it from DB"B"

That's it !
Thanks in advance for your help!

Arvin Meyer said:
OK Let's try again:

SELECT * INTO NewTableName IN "C:\FullPathTo.mdb"
FROM [C:\FullPathOfOriginal.mdb].TableOrQueryName;
"
I'm not sure what ARTIKEL=OMZET is, but I am pretty sure that you cannot use
an = sign except in a where clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in Prijscontrole)
,this is input for the table"WINST" which must be found in Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from Catalogus.mdb)
in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


Arvin Meyer said:
Even easier, because I already have one of those. This one also uses a
Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a
"Make-table
Query"
Is that still possible?

Arvin Meyer [MVP]" wrote:

Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from
db"B"!
Is this possible?

Thanks in advance!
 
A

Arvin Meyer [MVP]

It is possible with an Append Query, and Update Query, a Make Table query,
and a Select Query. I've never even thought of trying it with either a Union
or Crosstab query.

INSERT INTO NGTest ( PersonID )
SELECT *
FROM [C:\Database\Data.mdb].tblAddresses
WHERE PersonID)=5;

The above inserts PersonID into a local table, (NGTest) from a Remote table
(tblAddresses in C:\Database\Data.mdb)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


J.Alladien said:
Arvin,

Another question, is this remote thing also possible with an "append qry"?
If yes could you send me an example cause I am trying but it's not working
out!

So I have an append QRY "C" in DB"A" and I want to run it from DB"B"

That's it !
Thanks in advance for your help!

Arvin Meyer said:
OK Let's try again:

SELECT * INTO NewTableName IN "C:\FullPathTo.mdb"
FROM [C:\FullPathOfOriginal.mdb].TableOrQueryName;
"
I'm not sure what ARTIKEL=OMZET is, but I am pretty sure that you cannot
use
an = sign except in a where clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in
Prijscontrole)
,this is input for the table"WINST" which must be found in
Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from
Catalogus.mdb)
in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


:

Even easier, because I already have one of those. This one also uses a
Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a
"Make-table
Query"
Is that still possible?

Arvin Meyer [MVP]" wrote:

Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from
db"B"!
Is this possible?

Thanks in advance!
 
A

Arvin Meyer [MVP]

The square brackets were necessary because of the = sign and the spaces.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Arvin,

Yes It worked!!! , only I had to put the tablename in brackets like this:

SELECT * INTO WINST IN 'F:\Voorraad\CATALOGUS.mdb'
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].[VERKOPEN PER ARTIKEL=OMZET];

Thanks a Lot , You guys are great , I would not know what to do without
the
community!




Arvin Meyer said:
OK Let's try again:

SELECT * INTO NewTableName IN "C:\FullPathTo.mdb"
FROM [C:\FullPathOfOriginal.mdb].TableOrQueryName;

I'm not sure what ARTIKEL=OMZET is, but I am pretty sure that you cannot
use
an = sign except in a where clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

J.Alladien said:
Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in
Prijscontrole)
,this is input for the table"WINST" which must be found in
Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from
Catalogus.mdb)
in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


:

Even easier, because I already have one of those. This one also uses a
Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a
"Make-table
Query"
Is that still possible?

Arvin Meyer [MVP]" wrote:

Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from
db"B"!
Is this possible?

Thanks in advance!
 
J

J.Alladien

Works like a charm,

Thanks a lot Arvin,you have been a great help!


Arvin Meyer said:
It is possible with an Append Query, and Update Query, a Make Table query,
and a Select Query. I've never even thought of trying it with either a Union
or Crosstab query.

INSERT INTO NGTest ( PersonID )
SELECT *
FROM [C:\Database\Data.mdb].tblAddresses
WHERE PersonID)=5;

The above inserts PersonID into a local table, (NGTest) from a Remote table
(tblAddresses in C:\Database\Data.mdb)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


J.Alladien said:
Arvin,

Another question, is this remote thing also possible with an "append qry"?
If yes could you send me an example cause I am trying but it's not working
out!

So I have an append QRY "C" in DB"A" and I want to run it from DB"B"

That's it !
Thanks in advance for your help!

Arvin Meyer said:
OK Let's try again:

SELECT * INTO NewTableName IN "C:\FullPathTo.mdb"
FROM [C:\FullPathOfOriginal.mdb].TableOrQueryName;
"
I'm not sure what ARTIKEL=OMZET is, but I am pretty sure that you cannot
use
an = sign except in a where clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Arvin,

As I am not so experienced please help me on this ,I did the following:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST IN
"F:\Voorraad\CATALOGUS.mdb"
FROM [F:\Voorraad\PRIJSCONTROLE.mdb].qryVERKOPEN PER ARTIKEL=OMZET;

The Query is "VERKOPEN PER ARTIKEL=OMZET" (which resides in
Prijscontrole)
,this is input for the table"WINST" which must be found in
Catalogus.mdb
after the update ,but on saving the query as above I get
"Syntax error in FROM clause"

What Am I doing wrong ?

Bye the way the make table query(which I want to run from
Catalogus.mdb)
in
prijscontrole.mdb is as follows:

SELECT [VERKOPEN PER ARTIKEL=OMZET].* INTO WINST
FROM [VERKOPEN PER ARTIKEL=OMZET];

hope you can help me!


:

Even easier, because I already have one of those. This one also uses a
Where
clause to build a table with a single record:

SELECT qryCode.CodeID, * INTO NGTest IN "C:\Data\Projects\Code.mdb"
FROM [C:\Data\Data.mdb].qryCode
WHERE (((qryCode.CodeID)=875));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Dear Arvin
Thanks a lot for the quick reply,

however I forgot to mention that in this case the query is a
"Make-table
Query"
Is that still possible?

Arvin Meyer [MVP]" wrote:

Sure, from query A :

SELECT qryX. *
FROM [F:\Foldername\dbB.mdb].qryX;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Dear All,


I Need to run a query "X" from db"A" but it must be done from
db"B"!
Is this possible?

Thanks in advance!
 
Top