Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LoadXML method of XMLAdapter
Message
From
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:
01406418
Views:
71
This message has been marked as a message which has helped to the initial question of the thread.
>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 ?
see picture of message#1406398


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
*-------------------------------------------------------------------------------
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform