Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LoadXML method of XMLAdapter
Message
 
 
À
16/06/2009 13:26:41
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:
01406420
Vues:
53
Looks like it's a bug in ToCursor method - if you don't specify the alias name, it works, with alias name - it doesn't.

I already implemented the code you posted (just checked for last 2 characters), thanks again - but now I'm back to square one with the 1 problem.

>>Doesn't work - the fields are still memo.
>>
>>for i = 1 to .Tables.Count
>>			=.Tables[m.i].ToCursor(.T., 'cOrders')
>>		endfor
>
>
>Dunno, but if you are appending to an existing cursor - how is it defined ?
>
>ps: finding orderpk and customerfk
>
>
>*-------------------------------------------------------------------------------
>function do_it()
>
>	local obj, i, TableObj, FieldObj
>	
>	obj = createObject('xmladapter')
>	
>	with m.obj
>		.LoadXml('\tmp\ppp.xml', TRUE, TRUE)
>		
>		for each TableObj in .Tables
>			for each FieldObj in m.TableObj.Fields
>			
>				if( inlist(lower(unicode_from(m.FieldObj.XmlName)), 'orderpk', 'customerfk') )
>					FieldObj.DataType = 'C'
>					FieldObj.MaxLength = 36
>				endif
>			
>			endfor
>		endfor
>		
>
>		for i = 1 to .Tables.Count
>			=.Tables[m.i].ToCursor()
>		endfor
>		
>	
>	endwith
>endfunc
>*---------------------------------------------------------------------------
>function unicode_To(v)
>	return strconv(m.v, 12)
>endfunc
>*-------------------------------------------------------------------------------
>function unicode_from(v)
>	return strconv(m.v, 10)
>endfunc
>*-------------------------------------------------------------------------------
>
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