Help:
strSQL = "INSERT INTO """ & dbTarget.TableDefs!tbl.Name & """ * SELECT
* FROM """ & dbSource.TableDefs!tbl.Name & """;"
dbTarget, dbSource are type dao.database
tbl is type tabledef
Trying to copy records into revised back end file. I can't figure out
the syntax for referring to external tables.
Thanks!
THANKS!
David G.
I would suggest an altogether different approach if you're trying to copy
tables (or all the contents of tables) into an otherwise empty target
database; the TransferDatabase method. Will that not work for you?
That said... you can use the IN clause; from the "In Clause" topic in the
Microsoft Jet SQL reference topic in Help:
To identify a destination table:
[SELECT | INSERT] INTO destination IN
{path | ["path" "type"] | ["" [type; DATABASE = path]]}
To identify a source table:
FROM tableexpression IN
{path | ["path" "type"] | ["" [type; DATABASE = path]]}
A SELECT statement containing an IN clause has these parts:
Part Description
destination The name of the external table into which data is inserted.
tableexpression The name of the table or tables from which data is retrieved.
This argument can be a single table name, a saved query, or a compound
resulting from an INNER JOIN, LEFT JOIN, or RIGHT JOIN.
path The full path for the directory or file containing table.
type The name of the database type used to create table if a database is not a
Microsoft Jet database (for example, dBASE III, dBASE IV, Paradox 3.x, or
Paradox 4.x).