Update,copy Database

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
 
P

Peter Doering

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
 
J

Joe

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.
 
P

Peter Doering

I just re-read the question, forget my first answer. This is what you need:

INSERT INTO TargetTable
SELECT * FROM SourceTable;

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top