[AccessD] ExportXML CreateAdditionalData Named Argument Error

Charlotte Foust charlotte.foust at gmail.com
Thu Jul 15 21:26:56 CDT 2010


In that case, your best bet would be to create a query with the data
in it and export the query results to xml.  I suspect you're going to
have to include the key fields used in the joins in your export.  I
must admit, I've not tried this from Access.  I've only written .Net
code to export data to xml and the process is a bit different.

Charlotte Foust

On Thu, Jul 15, 2010 at 3:14 PM, Bud Goss <bgoss711 at ameritech.net> wrote:
>
> 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
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list