-->
Application Development
Change Data Capture
Constraints
Data Science
Data Types
Database Design
Dates
Debugging
DevOps
Dynamic Management Views
Dynamic SQL
Encryption
Entity Framework
Error Handling
Excel Integration
Full Text Search
Functions - System
Functions - User Defined
Identities
Import and Export
In-Memory OLTP
JOIN Tables
LINQ
Microsoft Access
Microsoft Flow
Paging
Power BI
Python
Query Optimization
Query Plans
Scripts
Service Broker
Spatial Data Storage
SQL Injection
SQL Mgmt Objects (SMO)
Stored Procedures
Synonyms
T-SQL
Table Valued Parameters
Temp Tables
Temporal Tables
Testing
Transactions
User Defined Type UDT
Views
XML
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.
Syntax
Administrators can export an update set as an XML file to save a specific version of an application or set of changes.Administrators can load an update set XML.
expression.ExportXML (ObjectType, DataSource, DataTarget, SchemaTarget, PresentationTarget, ImageTarget, Encoding, OtherFlags, WhereCondition, AdditionalData)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ObjectType | Required | AcExportXMLObjectType | An AcExportXMLObjectType that represents the type of AccessObject object to export. |
DataSource | Required | 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 | Optional | String | The file name and path for the exported data. If this argument is omitted, data is not exported. |
SchemaTarget | Optional | 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 | Optional | String | The file name and path for the exported presentation information. If this argument is omitted, presentation information is not exported. |
ImageTarget | Optional | String | The path for exported images. If this argument is omitted, images are not exported. |
Encoding | Optional | AcExportXMLEncoding | An AcExportXMLEncoding constant that specifies the text encoding to use for the exported XML. The default value is acUTF8. |
OtherFlags | Optional | AcExportXMLOtherFlags | A bit mask that specifies other behaviors associated with exporting to XML. Can be a combination of AcExportXMLOtherFlags constants. |
WhereCondition | Optional | String | Specifies a subset of records to be exported. |
AdditionalData | Optional | Variant | Specifies additional tables to export. This argument is ignored if the OtherFlags argument is set to acLiveReportSource. |
Return value
Nothing
Remarks
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.
Example
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.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Browse Categories
AggregatesApplication Development
Change Data Capture
Constraints
Data Science
Data Types
Database Design
Dates
Debugging
DevOps
Dynamic Management Views
Dynamic SQL
Encryption
Entity Framework
Error Handling
Excel Integration
Full Text Search
Functions - System
Functions - User Defined
Identities
Import and Export
In-Memory OLTP
JOIN Tables
LINQ
Microsoft Access
Microsoft Flow
Paging
Power BI
Python
Query Optimization
Query Plans
Scripts
Service Broker
Spatial Data Storage
SQL Injection
SQL Mgmt Objects (SMO)
Stored Procedures
Synonyms
T-SQL
Table Valued Parameters
Temp Tables
Temporal Tables
Testing
Transactions
Triggers
User Defined Type UDT
Views
XML
Data
Functions
Performance
Tools