创建 AdditionalData 对象,该对象可用于向由 ExportXML 方法导出的父表添加附加的表和查询。返回 AdditionalData。
expression.CreateAdditionalData()
expression 必需。返回 Application 对象的表达式。
下例将 Northwind Traders 示例数据库的 Customer 表的内容连同 Orders 和 Orders Details表内容一起导出为名为 Customer Orders.xml 的 XML 数据文件。
Sub ExportCustomerOrderData()
Dim objOrderInfo As AdditionalData
Set objOrderInfo = Application.CreateAdditionalData()
' Add the Orders and Order Details tables to the data to be exported.
objOrderInfo.Add "Orders"
objOrderInfo.Add "Order Details"
' Export the contents of the Customers table. The Orders and Order
' Details tables will be included in the XML file.
Application.ExportXML ObjectType:=acExportTable, DataSource:="Customers", _
DataTarget:="Customer Orders.xml", _
AdditionalData:=objOrderInfo