Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LoadXML method of XMLAdapter
Message
 
 
To
16/06/2009 13:26:41
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:
01406420
Views:
54
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform