Friday, May 13, 2005

Update XML datasource, why does it different with other?

CursorAdapter and XMLAdapter were introduced in VFP8. However, I just try it out recently. I plan to use XML file as data source for my system configuration. Thank you Cetin Basoz for helping me to make my code works.
CA=CREATEOBJECT("CURSORADAPTER")
xa=CREATEOBJECT("xmladapter")
xa.LoadXML("myxml.xml",.T.)
ca.SelectCmd="xa.tables.item(1)"
ca.DataSourceType="XML"
ca.CursorFill()
xa.Tables.Item(1).ToCursor()
xa.ReleaseXML(.F.)
*-- Make some changes here
xa.ToXML('updated.xml','',.T.)
Why couldn't we just call TABLEUPDATE() to commit changes?

0 Comments:

Post a Comment

<< Home