Export related tables to XML (code error)

  • Thread starter Thread starter ditimar
  • Start date Start date
D

ditimar

I got a code on the help of Microsoft but when I try to compile it give´s
the error message:
“Compilation Error: Argument not namedâ€
I added the references: Microsoft XML v5.0, Microsoft Data Access Components
Instaled Version, Microsoft Visual basic for Applications Extensibility 5.3,
Microsoft Access 11.0 Object Library

The code and the references are exposed above :
Please,somebody knows how can I resolve this problem?


Private Sub ExportRelTables()
' 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"
objAD(Item:="Order Details").Add "Order Details Details"
.Add "Customers"
.Add "Shippers"
.Add "Employees"
.Add "Products"
objAD(Item:="Products").Add "Product Details"
.Add "Suppliers"
.Add "Categories"
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
End Sub
 
ditimar said:
I got a code on the help of Microsoft but when I try to compile it give´s
the error message:
“Compilation Error: Argument not namedâ€
I added the references: Microsoft XML v5.0, Microsoft Data Access Components
Instaled Version, Microsoft Visual basic for Applications Extensibility 5.3,
Microsoft Access 11.0 Object Library

The code and the references are exposed above :
Please,somebody knows how can I resolve this problem?


Private Sub ExportRelTables()
' 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"
objAD(Item:="Order Details").Add "Order Details Details"
.Add "Customers"
.Add "Shippers"
.Add "Employees"
.Add "Products"
objAD(Item:="Products").Add "Product Details"
.Add "Suppliers"
.Add "Categories"
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
End Sub
 
Back
Top