>>Hmmmm.... it doesn't work right for me...
>>
>>I sort of get the data from SQL Server - it'll have a blank line at the top and an extra ElementType column (which is presumably from the schema).
>>
>>Here's what I'm doing to test (against SQL Server's Pubs database queried through IIS):
>>
>
>Ok, yeah I had forgotten that you can get that when you specify XMLDATA in the query. You get all the records and all the fields when you leave that off though, it's just that XMLToCursor has to guess at the field types. It usually does a pretty good job at this, but it can get screwed up with say, a character field that contains all numbers.
I have lots of problems with XMLTOCURSOR() guessing. Dates for example almost always end up as strings.
The problem *with* the schema is a bug... that should work.
>FWIW, VFP still screws up the data types when you specify XMLDATA, even though the schema is right there. Notice in the results in your example that the zipcode field is numeric.
Yeah, it's like I said XMLTOCURSOR() really works right only if you feed it data that comes with the same schema as the CURSORTOXML() generates. Beyond that you're gambling on VFP trying to guess...
Not happy with the design of that function... <s>
+++ Rick ---