Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ExportXML, AdditionalData and Nested tables 1

Status
Not open for further replies.

Custardptt

Technical User
Jan 12, 2005
31
0
0
GB
Hi All,

I'm attempting to export data from several related tables as XML. The Structure is rather particular and looks something like this

BaseTable
Table2
Table3
Table4

When I do the Export, only the first relationship is preserved and the XML looks like:

BaseTable
Table2
Table3
Table4

If I manually export the table as it works fine.

My Export script look like this:
Dim AdData As AdditionalData
Set AdData = Application.CreateAdditionalData
AdData.Add "Table2"
AdData.Add "Table3"
AdData.Add "Table4"
Application.ExportXML acExportTable, "BaseTable", "C:\export.xml", , , , acUTF16, , , AdData
I had assumed that there's a way of telling the AddittionalData object how the other tables are related but I cant see how this is done and google has failed me this time.

Does Anyone here know

Thanks in advance

Pete
 
ExportXML Method [Access 2003 VBA Language Reference]
msdn.microsoft.com/en-us/library/aa221224(office.11).aspx

If you look at the example in the above article, your code is slightly different. Try theirs as is and see if that works.
 
Hi fneily,

Thanks for the link, I hadn't clocked that I needed to nest the AddittionalData objects.

Cheers

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top