Microsoft KB Archive/295468

= ACC2002: ExportXML Method of the Data Source Control Is Incorrectly Documented in Help =

Article ID: 295468

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q295468



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
The ExportXML method of the Data Source Control Help topic shows the syntax to save the current recordset as an XML file as follows: expression.ExportXML(XMLDataTransformFile, eEncoding) This syntax is incorrect.



RESOLUTION
Use the following syntax: MSODSC.ExportXML [eEncoding] The eEncoding argument is optional. Of the six constants, or values, that can be assigned to the eEncoding argument, only two are valid. They are:

If you exclude this argument when you use this method, dscUTF8 (zero) will be the value used by default. If you include this argument and choose to use the constant instead of the literal value, you must qualify the constant, similar to the following: MSODSC.ExportXML MSODSC.Constants.dscUTF8 If you use a constant without including a qualifier, such as MSODSC.Constants., the ExportXML method will assign a value of zero to the eEncoding argument.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
To view the ExportXML method of the Data Source Control in Help:  Start Access, and then open the sample database Northwind.mdb. Open the Employees data access page in Design view. On the Tools menu, point to Macro, and then click Microsoft Script Editor. On the Help menu, click Microsoft Script Editor Help. Type exportxml method in the Answer Wizard, and then click Search. This displays the following Help information:

ExportXML Method
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.

eEncoding Optional DscEncodingEnum. The format in which schema information is exported. If this argument is omitted, schema information is embedded in the data document.

DscEncodingEnum can be one of these DscEncodingEnum constants.

dscEUCJ

dscUCS2

dscUCS4

dscUTF16

dscUTF8default

dscWindows

</li></ol>

Although this Help topic includes the XMLDataTransformFile argument as the initial argument for the ExportXML method, this argument has been removed from the method. Currently, the ExportXML method contains only one argument, eEncoding. This argument is an optional argument.

This Help topic is correct in that the ExportXML method does save the current recordset to an XML file, but this topic should list the proper syntax as follows: expression.ExportXML [eEncoding] This Help topic also lists six constants that can be assigned to the eEncoding argument. However, only two of these constants are valid. They are dscUTF8 (the default) and dscUTF16. If you use any of the other four constants, you receive the following run-time error:

Object doesn't support this property or method.

Additional query words: pra

Keywords: kberrmsg kbbug kbnofix kbdocerr kbdapscript KB295468

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.