PRB: Error Message When MSXML DOMDocument Is Loaded by Supplying an ADO 2.5 Stream Object (283164)
The information in this article applies to:
- Microsoft XML 2.0
- Microsoft XML 2.5
- Microsoft XML 2.6
- Microsoft XML 3.0
- Microsoft XML 3.0 SP1
- Microsoft XML 4.0
- ActiveX Data Objects (ADO) 2.5
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q283164 SYMPTOMS
If you attempt to run the Load method of an MSXML DOMDocument object by supplying an ActiveX Data Object (ADO) 2.5 Stream object that contains valid XML data as the xmlSource parameter, the following error message is generated:
Run-time error '5': Invalid procedure call or argument
CAUSE
A string that specifies the path of the XML file to be loaded, or a Component Object Model (COM) object that is queryable for the IStream interface can be supplied as the xmlSource parameter when you run the Load method of the DOMDocument object. The ADO 2.5 Stream object is not internally queryable for the IStream interface.
RESOLUTION
There are two possible solutions to the problem:
- If you upgrade to MDAC 2.6, the problem does not occur when you supply an ADO 2.6 Stream object as the xmlSource parameter for the Load method of an MSXML DOMDocument object. The ADO 2.6 Stream object is internally queryable for the IStream interface.
-or-
- If you cannot upgrade to MDAC 2.6, the ReadText method of the ADO 2.5 Stream object returns the contents of an adTypeText Stream object as a string. Run the loadXML method of the MSXML DOMDocument and supply the string returned by running the ReadText method of the Stream object as the bstrXML parameter.
STATUS
This problem has been fixed in MDAC 2.6. The Implementation of the ADO 2.6 Stream object has been modified to make it internally queryable for the IStream interface.
For more information, see the MDAC pages on the following Microsoft Web site at:
Modification Type: | Major | Last Reviewed: | 3/7/2003 |
---|
Keywords: | kbprb KB283164 kbAudDeveloper |
---|
|