View Full Version : TransferDatabase -- data only?


casey
09-09-2003, 12:33 PM
Hello all,

Can I use the TransferDatabase method to export a table's data into a second table without altering the second table's structure?

I have two tables with matching fields only the second table has an additional field. I would like to export the data from the first table to the second without losing the structure of the second table. Everytime I run the command, the second table's structure gets overwritten and I lose the additional field in that table.

Please advise if this makes sense. Thanks.

DoCmd.TransferDatabase acExport, "C\Owner\data9.3.mdb", acTable, "tableA", "tableB", 0

Prior to xfer:
tableA:
fld1, fld2
tableB:
fld1, fld2, fld3

After xfer:
tableA:
fld1, fld2
tableB:
fld1, fld2
(fld3 gets eliminated)

I know that if I do this manually I can get it to transfer without overwriting the destination table's structure. But can I do it using the TransferDatabase method?

jeremie_ingram
09-09-2003, 12:37 PM
It would be much better to use queries, and append the data to the second table if possible.

casey
09-09-2003, 01:03 PM
That was quick! Thanks for the reply.

Can't this be done with the TransferDatabase method? I'm just in testing(playing w/ this method), but eventually the actual tables will be located in a separate database entirely. The way MS puts it, TransferDatabase is the way to go. I guess I don't know, but more information would be helpful. Thanks.