Update,copy Database

  • Thread starter Thread starter Network Numbskull
  • Start date Start date
N

Network Numbskull

I want to set up a update or copy database query that will
update or copy one table to another.I want it to import
all the fields to another existing table.The two table are
identical in structure.Any assistance would be greatly
appriciated.

Thanks ahead of time
The Network Numbskull
 
I want to set up a update or copy database query that will
update or copy one table to another.I want it to import
all the fields to another existing table.The two table are
identical in structure.Any assistance would be greatly
appriciated.

Why in a query?

If the DB's are identical you can use
FileCopy "Source.mdb", "Destination.mdb" in a module.

If you want to bring all tables from another DB one by one across to the
current DB, you can use
DoCmd.TransferDatabase (see OH).

If you want it in a query you have to setup one query for each table and
use e.g.:

SELECT * FROM [C:\MyPath\MyOld.mdb].MyTable INTO MyTable;
or
SELECT * INTO [C:\MyPath\MyNew.mdb].MyTable FROM MyTable;

HTH - Peter
 
Create an append query that will append the data to
your existing table. Create a new query in design mode.
Click Append Query and then input the table you want to
append records to.

On the QBE screen, add the table with the existing data
and then copy the fields into the structure. If the table
to be appended to already has the same structure, the
fields should be populated below. Then run the query.
 
I just re-read the question, forget my first answer. This is what you need:

INSERT INTO TargetTable
SELECT * FROM SourceTable;

Peter
 
Back
Top