I have tried everything I can think of to move records from one Access
database to another. It should not be that hard. Read on....
I have identical access mdb's. One contains data; one contains empty
tables. From an earlier posting, I was able to move the data by first
exporting XML files and then importing them. I would like to find a way to
skip the Import/Export steps.
I first read the tables into a DataSet from the full database using a
DataAdapter. At this point the following code does the Export/Import.
oDS.WriteXml(sDir & "\BackUp.xml")
oDS.WriteXmlSchema(sDir & "\BackUp.xsd")
oDS_New.ReadXmlSchema(sDir & "/BackUp.xsd")
oDS_New.ReadXml(sDir & "/BackUp.xml")
oDS.Merge(oDS_New, True)
oDS is the DataSet created from the full database. By using oDS.Merge()
method, I can use the oDS to successfully populate the empty mdb by using a
connection to that database and a DataAdapter. There must be a way to skip
the Import/Export.
I have unsuccessfully tried using oDS_New = oDS.Clone and other ideas. to
replace the four Read/Write steps. None work. Any suggestions will be
appreciated.