Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can VFP load this XML into a cursor?
Message
From
01/11/2005 15:37:16
 
 
To
01/11/2005 15:33:16
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01064105
Message ID:
01064177
Views:
38
You don't need a connection for this one. Just do this:

r = CreateObject("Adodb.Recordset")
r.Open("myrsdata.xml")

Should work if it is an ADO rs. (to the best of my guessing abilities, it is)

>Hi Crescencio,
>
>I don't know if this is an XML-persisted ADO recordset, however, when I tried your suggestion to load the XML file into an ADO recorset, I get the following error:
>
>
>Microsoft Visual FoxPro 9.0
>OK
>Help
>OLE IDispatch exception code 0 from ADODB.Recordset: The connection cannot be used to perform this operation. It is either closed or invalid in this context...
>
>
>So does this mean that it is not an ADO recordset or did I miss something?
>
>Mike
>
>
>
>>Isn't this xdr for an XML-persisted ADO recordset?
>>
>>Try instantiating and ADO recordset object, and loading from file. From there you can convert to VFP cursor if need be, but you wouldn't have to. (unless you want to bind)
>>
>>ex: myRs.Open("myfile.xml")
>>
>>>I have an XML file with the following format:
>>>
>>>
>>><xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
>>>	xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
>>>	xmlns:rs='urn:schemas-microsoft-com:rowset'
>>>	xmlns:z='#RowsetSchema'>
>>><rs:data>
>>><z:row Field1='Field1' Field2='Field2' Field3='Field3' Field4='Field4' />
>>></rs:data>
>>></xml>
>>>
>>>
>>>Can VFP load this into a cursor showing one row and four fields? I've tried XMLTOCURSOR() and XMLADAPTER but neither can produce the results I need.
>>>
>>>TIA
>>>
>>>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform