• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

18. XML > 18.6. Export Unrelated Tables

18.6. Export Unrelated Tables

Problem

You want to export Access data to a single XML file, but the tables you wish to export are not related to each other. How do you select tables and create a single XML output file?

Solution

You must write VBA code to export multiple unrelated tables to a single XML file. The Access object model provides the ExportXML method, which has an AdditionalData parameter that takes an object of type AdditionalData.

The 18-06.MDB sample database contains three unrelated tables: Car, Customer, and Dealer. There is a single module, basExport, which contains the function ExportUnrelated. The code creates an AdditionalData object, and adds the Customer and Dealer tables to it. The ExportXML method uses the Car table as the DataSource, and uses the AdditionalData object to add the Customer and Dealer data to the output:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint