Charlotte Foust
charlotte.foust at gmail.com
Thu Jul 15 11:47:19 CDT 2010
Just a swag, but notice the differences between your Order Details lines .Add "Order Details" > objAD(Item:="Order Details").Add "Order Details Details" > and this: .Add "Products" > objAD(Item:="Products").Add "Product Details" > objAD(Item:="Products")(Item:="Product Details").Add _ > "Product Details Details" It looks to me like the code is adding an element to the xml that is dependent on the initial element. Do you actually have a field in the data called "Order Details"? If so, then the "Order Details Details" is assigned the doubled name to distinguish it from its parent element. Since you're getting a "named argument not found" error, I would suspect that the item Order Details doesn't actuall exist. Is there any more information in the error message? Charlotte On Thu, Jul 15, 2010 at 9:21 AM, Bud Goss <bgoss711 at ameritech.net> wrote: > Tannks for the reply Darryl. > > I may have to go that route or use some other non Access tool. > > But it would be better if I could use standard Access VBA code. My application requirements has a number of related tables. The code shown below would seem to have a high proability of being a good fit - if it would work. > > Bud > > > I might be off target here, but MZ Tools will generate an XML export. Would that work for you? > > Regards > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bud Goss > Sent: Thursday, 15 July 2010 2:41 PM > To: accessd at databaseadvisors.com > Subject: [AccessD] ExportXML CreateAdditional Data Named Argument Error > > I am attempting to generate a fairly complex .xml file with Access 2003 > > The code listed below is from a Microsoft support article as an example of the ExportXLM method AdditionalData Object for use with the Northwind database > > Problem is that it will not compile - gives a Named Argument Not Found on line: > objAD(Item:="Order Details").Add "Order Details Details" > > ( Probably an typo error on above line > objAD(Item:="Order Details").Add "Order Details" gives same error) > > This same question/problem was posted to MSDN a while back but - I could find any posted.answer. > > Can anyone tell me how to fix this error? > > > Private Sub ExportRelTables() > ' Purpose: Exports the Orders table as well as > ' a number of related database 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" > objAD(Item:="Order Details").Add "Order Details Details" > .Add "Customers" > .Add "Shippers" > .Add "Employees" > .Add "Products" > objAD(Item:="Products").Add "Product Details" > objAD(Item:="Products")(Item:="Product Details").Add _ > "Product Details Details" > .Add "Suppliers" > .Add "Categories" > End With > Application.ExportXML acExportTable, "Orders", _ > "C:\Orders.xml", "C:\OrdersSchema.xsd", _ > "C:\OrdersStyle.xsl", AdditionalData:=objAD > End Sub > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >