ExportXML Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Saves the current recordset as an XML file.

expression.ExportXML(XMLDataTransformFile, eEncoding)

expression   Required. An expression that returns a DataSourceControl object.

XMLDataTransformFile  Optional Variant. A path to an XSLT file.

DscEncodingEnum

DscEncodingEnum can be one of these DscEncodingEnum constants.
dscEUCJ
dscUCS2
dscUCS4
dscUTF16
dscUTF8default
dscWindows

Remarks

Use the XMLLocation property to set whether the data is exported to an XML data island or a separate XML data file. Use the XMLDataTarget property to specify the path or ID to use when exporting the data.

Example

This example exports the current data in the data source control named MSODSC to an XML data file.

  Sub ExportData()

   Dim dscConstants

   Set dscConstants = MSODSC.Constants

   ' Set the location of the XML data to a data file.
   MSODSC.XMLLocation = dscConstants.dscXMLDataFile

   ' Set the specific target to export to.
   MSODSC.XMLDataTarget = "Q1 Sales Analysis.xml"

   ' Export the current data.
   MSODSC.ExportXML

End Sub