Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LoadXML method of XMLAdapter
Message
 
 
To
16/06/2009 12:11:50
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01406258
Message ID:
01406400
Views:
58
>>>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
>					
>					&& also possible
>					&& .DataType = 'V'
>					&& .MaxLength = 50
>				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
Previous
Reply
Map
View

Click here to load this message in the networking platform