Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LoadXML method of XMLAdapter
Message
 
 
À
16/06/2009 12:11:50
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01406258
Message ID:
01406413
Vues:
57
>>>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
>
>(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
>
The names of the fields are empty and XmlName shows space between each letter. I guess I only can test by type, not by name.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform