Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ado cursoradapter using xml data
Message
From
27/09/2004 15:39:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Ado cursoradapter using xml data
Miscellaneous
Thread ID:
00946405
Message ID:
00946405
Views:
45
Hi all,

Given that I have a CursorAdapter using ADO to a VFP table. What would be the best way to update data (CalcDeploy) back to the table from an xml file. Note that the primary key data is not provided in the xml file, only the candidate key data is provided. See example:
* VFP Table: WhseProds.dbf (Deploy.dbc)
* Structure: WPID i, Whse c(10), Prod c(10), calcDeploy i
* where: WPID = primary key; whse+prod = candidate key
* This is the source data in xml format and does not use XSD.
<DeployData>
  <WhseProd Whse="W0" Prod="P1" CalcDeploy="100" />
  <WhseProd Whse="W0" Prod="P2" CalcDeploy="200" />
  <WhseProd Whse="W0" Prod="P3" CalcDeploy="300" />
  <WhseProd Whse="W1" Prod="P1" CalcDeploy="100" />
  <WhseProd Whse="W1" Prod="P2" CalcDeploy="200" />
  <WhseProd Whse="W1" Prod="P3" CalcDeploy="300" />
</DeployData>
My current implementation is:
1. create a cursoradapter with select & update settings using ADO.
1.1 selectcmd has parameters ?cWhse & ?cProd
2. load the xml to a dom object.
3. for each element attribute combination of Whse + Prod, I
would issue a cursorfill() and sendupdates=.t.

This process seems to me as very kludgy. Is there a better way
to do it?
ramil
~~ learning to stand still
Reply
Map
View

Click here to load this message in the networking platform