I’m using Visual FoxPro 9 on Vista in the administrator account. I’m trying to execute the following program:
cFile = "c:\XMLAdapter\CustomerXML.xml"
adapter = CREATEOBJECT("XMLAdapter")
adapter.LoadXML(cFile,.T.)
adapter.Tables(1).ToCursor()
I’ve copied this program verbatim (except for changing the path of the XML file) from an article in Code Magazine ( Converting XML to VFP Cursors Using the XMLAdapter ). When I execute it, I get the following error: Index or expression does not match an existing member of the collection. It is crashing on the last line of the program.
In the same article, there is also this program:
cFile = "c:\XMLAdapter\EmployeeXML.xml"
OPEN DATABASE (_samples+"\northwind\northwind")
SELECT employeeid, lastname ;
FROM Employees;
INTO CURSOR curEmployees
adapter = CREATEOBJECT("XMLAdapter")
adapter.AddTableSchema("curEmployees")
adapter.ToXML(cFile,,.T.)
This works perfectly.
I’d really appreciate it, if anyone could help me understand why the first program is crashing?
Thanks