Application.CreateAdditionalData 方法 (Access)

创建一个 AdditionalData 对象,该对象可用于将其他表和查询添加到 由 ExportXML 方法导出的父表。

语法

表达式CreateAdditionalData

expression:表示 Application 对象的变量。

返回值

AdditionalData

示例

下面的示例将 Northwind Traders 示例数据库的 Customers 表格的内容连同 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 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。