>>>Gregory,
>
>>
>>This is saved to clipboard with _cliptext = lcXML.
>
>
>The 'problem' is that the pk and fk are defined as xs:string without maxLength attribute. Hence vfp makes it big enough (=memo) to hold the max length string
>
>Two solutions
>(1) Have the maxLength added to the schema, if possible at all
>
I think we need to apply this solution - I now seem to remember this (or similar) problem discussed before.
>(2) Massage the Fields before calling ToCursor - and voila
>[ better would be to go through the tables collections, field collections and looking for the field (names) to modify - this is a quick way]
>
>
> local obj, i
>
> obj = createObject('xmladapter')
>
> with m.obj
> .LoadXml('\tmp\ppp.xml', TRUE, TRUE)
>
> with .Tables(1)
> for i = 1 to 2
> with .Fields(m.i)
>
> .DataType = 'C'
> .MaxLength = 36
>
>
>
>
> endwith
> endfor
> endwith
>
> for i = 1 to .Tables.Count
> =.Tables[m.i].ToCursor()
> endfor
>
>
> endwith
>
Though the second is easy too - thanks again.
Thank you so much.
If it's not broken, fix it until it is.
My Blog