PDA

Click to See Complete Forum and Search --> : duplicating a table


kovan
Sep 26th, 2000, 07:53 AM
i would like to knwo how to duplicated a table
not withing same db
i want a table in db1 to be copied to db2...
any help would be greatly appreciated, thank you

without out redefining all fields
i know this can be done in oracle
but dont know how it can be done in access



[Edited by kovan on 09-26-2000 at 08:59 AM]

simonm
Sep 26th, 2000, 08:01 AM
Use the SQL 'SELECT ... INTO' statement.

It would look something like this:

'SELECT * INTO tbNew FROM [<db1 Path>].tbOld'

Where the above statement would be executed on your target database.

I know the above works on an MS Access database but I've never tried it on any other.

N.B. This copies all fields and data to the new database but you will lose any indexes (inc. primary keys) and possibly field data types.

Unfortunately, I don't think it's possible to append a tabledef object from one tabledefs collection to another!