[AccessD] ExportXML CreateAdditionalData Named Argument Error

Bud Goss bgoss711 at ameritech.net
Thu Jul 15 17:14:18 CDT 2010


Yes - the code shown below compiles and when run in the Northwind database generates an xml file with the customers and orders tables. 
But I need to get related files in an xml hierarchy such as :
 
customer
   order
      order line
  order
      order line
customer
   order
      order line
  order
      order line etc
 
So this really does not resolve my problem  Code that works
I am going out for a while and will check later today or tomorrow -Thanks again for reply- 

Public Sub Test001()
' Purpose: Exports the Orders table as well as
  ' a number of related databases to an XML file.
  ' XSD and XSL files are also created.
  Dim objAD As AdditionalData
  ' Create the AdditionalData object.
  Set objAD = Application.CreateAdditionalData
  ' Add the related tables to the object.
  With objAD
     .Add "Order Details"
     
     '##### Any of these lines these lines will cause the Named Argument Not Found Error
     'objAD(Item:="Order Details").Add "Order Details Details"
     'objAD(Item:="Order Details").Add "Order Details"
     'objAD(Item:="Order ID").Add "Order Details Details"
     'objAD(Item:="Order ID").Add "Order Details"
     '#####
      
     .Add "Customers"
    
  End With
  ' Export the Orders table along with the addtional data.
  Application.ExportXML acExportTable, "Orders", _
      "C:\Orders.xml", "C:\OrdersSchema.xsd", _
      "C:\OrdersStyle.xsl", AdditionalData:=objAD
      MsgBox "done xxx"
End Sub


More information about the AccessD mailing list