내보내기(0) 인쇄
모두 확장

Application.ExportXML Method (Access)

Office 2010

The ExportXML method allows developers to export XML data, schemas, and presentation information from Microsoft SQL Server 2000 Desktop Engine (MSDE 2000), Microsoft SQL Server 6.5 or later, or the Microsoft Access database engine.

.ExportXML(ObjectType, DataSource, DataTarget, SchemaTarget, PresentationTarget, ImageTarget, Encoding, OtherFlags, WhereCondition, AdditionalData)

A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

ObjectType

필수

AcExportXMLObjectType

A AcExportXMLObjectType that represents the type of AccessObject object to export.

DataSource

필수

String

The name of the AccessObject object to export. The default is the currently open object of the type specified by the ObjectType argument.

DataTarget

선택

String

The file name and path for the exported data. If this argument is omitted, data is not exported.

SchemaTarget

선택

String

The file name and path for the exported schema information. If this argument is omitted, schema information is not exported to a separate XML file.

PresentationTarget

선택

String

The file name and path for the exported presentation information. If this argument is omitted, presentation information is not exported.

ImageTarget

선택

String

The path for exported images. If this argument is omitted, images are not exported.

Encoding

선택

AcExportXMLEncoding

A AcExportXMLEncoding constant that specifies the text encoding to use for the exported XML. The default value is acUTF8.

OtherFlags

선택

AcExportXMLOtherFlags

A bit mask that specifies other behaviors associated with exporting to XML. Can be a combination of AcExportXMLOtherFlags constants.

WhereCondition

선택

String

Specifies a subset of records to be exported.

AdditionalData

선택

Variant

Specifies additional tables to export. This argument is ignored if the OtherFlags argument is set to acLiveReportSource.

Return Value

Nothing

Although the DataTarget, SchemaTarget, and PresentationTarget arguments are all optional, at least one must be specified when you are using this method. When the ExportXML method is called from within an AccessObject object, the default behavior is to overwrite any existing files specified in any of the arguments.

The following example exports the contents of the Customers table in the Northwind Traders sample database, along with the contents of the Orders and Orders Details tables, to an XML data file named Customer Orders.xml.

Sub ExportCustomerOrderData() 
 Dim objOrderInfo As AdditionalData 
 Dim objOrderDetailsInfo As AdditionalData 
 
 Set objOrderInfo = Application.CreateAdditionalData 
 
 ' Add the Orders and Order Details tables to the data to be exported. 
 Set objOrderDetailsInfo = objOrderInfo.Add("Orders") 
 objOrderDetailsInfo.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
Microsoft는 MSDN 웹 사이트에 대한 귀하의 의견을 이해하기 위해 온라인 설문 조사를 진행하고 있습니다. 참여하도록 선택하시면 MSDN 웹 사이트에서 나가실 때 온라인 설문 조사가 표시됩니다.

참여하시겠습니까?
표시:
© 2015 Microsoft