FIX: XMLToCursor Gives "Syntax Error" or C0000005 Error Message with More Than 128 Columns (316439)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 7.0

This article was previously published under Q316439

SYMPTOMS

The XMLToCursor function may report one of the following errors when it encounters more than 128 columns:
Fatal Error: Exception code=C0000005

-or-

Syntax Error

RESOLUTION

To 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

STATUS

Microsoft 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.

MORE INFORMATION

Steps to Reproduce Behavior

Save the following code in a program (.prg) file and then run the program:
#define FIELDCOUNT  	128
#define TABNAME    	"testtab"
#define FIELDNAME  	"fieldnu"
#define STRUTAB		"Strutable.dbf"
CLEAR
LOCAL lafieldinfo[FIELDCOUNT,16]
FOR lni = 1 TO FIELDCOUNT
   lafieldinfo[lni,1] = FIELDNAME +PADL(TRANSFORM(lni),3,'0')
   lafieldinfo[lni,2] = "C"
   lafieldinfo[lni,3] = 5
   lafieldinfo[lni,4] = 0
   lafieldinfo[lni,5] = .F.
   lafieldinfo[lni,6] = .F.
   FOR lnj = 7 TO 16
      lafieldinfo[lni,lnj] = ""
   ENDFOR 
ENDFOR
CREATE CURSOR TABNAME FROM ARRAY lafieldinfo
APPEND BLANK 
?(LEN(FIELDNAME)+3)*FIELDCOUNT
??CURSORTOXML(ALIAS(),'cXML',1,0)
USE IN TABNAME 
=XMLTOCURSOR(cXML,'cur')
RETURN 
				

Modification Type:MajorLast Reviewed:3/2/2002
Keywords:kbbug kbCodeSnippet kbDSupport kbvfp700fix KB316439