Board index » delphi » Heterogenous Queries On Access MDB Problem

Heterogenous Queries On Access MDB Problem

I intend to copy records between two tables in different Access 97 MDB.Is
there any way to use heterogenous queries rather than write codes in Delphi?
I've tried the solution discribed in Delphi help "Creating heterogenous
queries", but get an error "Queries on MS ACCESS tables are not supported by
local query engines".

Any suggestions is appreciate!

I'm using D4P3. Following is my SQL script:

Insert into ":alias1:Table1"
select * from ":alias2:Table2"

 

Re:Heterogenous Queries On Access MDB Problem


I just tried doing this...to no avail.  I ended up just running the query to
select the data, and created a tTable (in the context of the second
database) and just used the createtable and appendrecord methods to pull in
the data.  I would have liked to do it all in sql, so if any one has any
ideas for the future....

Rolland

Quote
Buzz <b...@mail.sc.cninfo.net> wrote in message

news:7igb7u$1hi5@forums.borland.com...
Quote
> I intend to copy records between two tables in different Access 97 MDB.Is
> there any way to use heterogenous queries rather than write codes in
Delphi?
> I've tried the solution discribed in Delphi help "Creating heterogenous
> queries", but get an error "Queries on MS ACCESS tables are not supported
by
> local query engines".

> Any suggestions is appreciate!

> I'm using D4P3. Following is my SQL script:

> Insert into ":alias1:Table1"
> select * from ":alias2:Table2"

Re:Heterogenous Queries On Access MDB Problem


I had problems doing this a while ago, and currently use

Insert into LocalTable in 'localdb.mdb'
select * from table2;

I use D3, Access7

HTH
Ray Cramer
R...@Pol.ac.uk

Quote
Buzz wrote:
> I intend to copy records between two tables in different Access 97 MDB.Is
> there any way to use heterogenous queries rather than write codes in Delphi?
> I've tried the solution discribed in Delphi help "Creating heterogenous
> queries", but get an error "Queries on MS ACCESS tables are not supported by
> local query engines".

> Any suggestions is appreciate!

> I'm using D4P3. Following is my SQL script:

> Insert into ":alias1:Table1"
> select * from ":alias2:Table2"

Re:Heterogenous Queries On Access MDB Problem


Quote
>Buzz wrote:

>I intend to copy records between two tables in different Access 97 >MDB.ipt:
>Insert into ":alias1:Table1" select * from ":alias2:Table2"

AFAIK, LocalSQL does not support inserting data from another table.
You can directly insert values like

  INSERT INTO tableA (name, phone, city) VALUES ("Jones", "12345",
  "Chicago")

but not

  INSERT INTO tableA SELECT * FROM tableB ...

To do this, you have to use a BatchMove, or you create a new table from
the result of a SELECT query with DbiMakePermanent.
_________
Andreas

Other Threads