FIX: The XMLToCursor() Function Causes a Fatal Exception If the Root Tag Is Missing (320128)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 7.0
This article was previously published under Q320128 SYMPTOMS
If you use the XmlToCursor function to write a string of XML data to a cursor, the following error is returned:
Fatal error: Exception code=C0000005
This error occurs if the [<VFPData>] root tags are not contained in the XML string.
RESOLUTIONTo resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack
WORKAROUND
To work around this issue if you have not installed Visual FoxPro 7.0 Service Pack 1 (SP1), add the <VFPData> tag to the beginning of the string and add the </VFPData> tag to the end of the string. This permits the cursor to be created. The following sample code demonstrates this method:
* If the myXmlString string does not contain the root tags in the string:
myXmlString = [<myTable my_fld1 = "ABCDE" />]
* Add them by using the following code:
myXmlString = [<VFPData>] + myXmlString + [</VFPData>]
* If it works, 1 is returned (meaning that one record has been created).
* Otherwise, 0 is returned (meaning that it did not succeed).
? XMLTOCURSOR(myXmlString, "mycursor")
STATUSMicrosoft has confirmed that this is a problem in Microsoft Visual FoxPro for Windows 7.0. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.
Modification Type: | Major | Last Reviewed: | 5/17/2002 |
---|
Keywords: | kbbug kbCodeSnippet kbDSupport kbVFP700sp1fix KB320128 |
---|
|