ExportXML Method
Exports data, schema, and/or presentation information for the specified Microsoft Access object as XML files.
expression.ExportXML(ObjectType, DataSource, DataTarget, DataTransform, SchemaTarget, SchemaFormat, SchemaTransform, PresentationTarget, PresentationTransform, ImageTarget, LiveReportSource, Encoding, OtherFlags)
expression Required. An expression that returns an Application object.
ObjectType Required AcExportXMLObjectType. The type of Access object to export.
AcExportXMLObjectType can be one of these AcExportXMLObjectType constants. |
acExportDataAccessPage |
acExportForm |
acExportFunction |
acExportQuery |
acExportReport |
acExportServerView |
acExportStoredProcedure |
acExportTable |
DataSource Required String. The name of the Access object to export. The default is the currently open object of the type specified by ObjectType.
DataTarget Optional String. The file name and path for the exported data. If this argument is omitted, data is not exported.
DataTransform Optional String. The name of the XSL file to apply to the data before it is written to the target file.
SchemaTarget Optional String. The file name and path for the exported schema information. If this argument is omitted, schema information is embedded in the data document.
SchemaFormat Optional AcExportXMLSchemaFormat. The format in which schema information is exported.
AcExportXMLSchemaFormat can be one of these AcExportXMLSchemaFormat constants. |
acSchemaNone default |
acSchemaXSD |
SchemaTransform Optional String. The name of the XSL file to apply to the schema information before it is written to the target file.
PresentationTarget Optional String. The file name and path for the exported presentation information. If this argument is omitted, presentation information is not exported.
PresentationTransform Optional String. The name of the XSL file to apply to the presentation information before it is written to the target file.
ImageTarget Optional String. The path for exported images. If this argument is omitted, images are not exported.
LiveReportSource Optional String. Connection information for a report containing live data. This may be a reference to an .odc file or an XMLSQL request. This argument is ignored if ObjectType is not acExportReport.
Encoding Optional AcExportXMLEncoding. The text encoding to use for the exported XML.
AcExportXMLEncoding can be one of these AcExportXMLEncoding constants. |
acEUCJ |
acUCS2 |
acUCS4 |
acUTF16 |
acUTF8 default |
OtherFlags Optional Long. A bit mask which specifies other behaviors associated with exporting to XML. The following table describes the behavior that results from specific values; values can be added to specify a combination of behaviors.
Value | Description |
---|---|
1 | Related tables Includes the "many" tables for the object specified by DataSource. |
2 | Relational properties Creates relational schema properties. |
4 | Run from server Creates an ASP wrapper; otherwise, default is an HTML wrapper. Only applies when exporting reports. |
8 | Special properties Creates extended property schema properties. |
Remarks
When the ExportXML method is called from within an Access object, the default behavior is to overwrite any existing files specified in any of the arguments. When the ExportXML method is called from within a data access page, the default behavior is to prompt the user before overwriting any existing files specified in any of the arguments.
Example
The following example exports the table called Customers in the current database as XML. The data and schema are exported as separate files, and the schema is in XSD format. Existing files are overwritten.
Application.ExportXML _
ObjectType:=acExportTable, _
DataSource:="Customers", _
DataTarget:="Customers.xml", _
SchemaTarget:="CustomersSchema.xml", _
SchemaFormat:=acSchemaXSD, _
OtherFlags:=1