ADOExpress problems !


I have a few problems. Let me first say that im a newbie at ADOexpress.
(Problem) It's like this ;
Im creating an application(.)where The user selects tables in a database. After the user has selected these tables, the application is supposed to save these (Recordsets) tables in  XML file(s). The application should also support, that the user selects an XML file and updates a table in the database.

So my question is.
What component in ADOExpress should i use to save and load xml files, I've read something about RecordSets...?.
I need some code Example in c++ or op, pleace.!
(I use BCB 5.0 )

Let me write some pseudo code.
-- first bit ----
do while list not Nil
 RecordList[i] =  get Recordset from table list()
for i to i.length() i+1

--- second bit.----

do while list not Nil
 Recordlist[i] = openXMLFile(list)
for i to i.length() i+1
-- end ---

/ wr Henrik Franzen
Who is Participating?
bnemmersConnect With a Mentor Commented:
Try using the SaveToFile & LoadFromFile using an
ADODataSet. Here's some sample code.

procedure TForm1.Button1Click(Sender: TObject);
  ADOTable1.SaveToFile('C:\TestXML.xml', pfXML);

procedure TForm1.Button2Click(Sender: TObject);
  if (FileExists('C:\TestXML.xml')) then


Good luck.
swingflyAuthor Commented:
Its not hard to load and save to an XML file, the problem is how do you update a database with an open XML file!
I assume you will not know what or if any record were updated, added or deleted.

Because in a sense you have two complete data set. Which one will be the master copy the new xml or the current table in the db?  
Without some control over the xml file you might have to step through each record in the 2nd (XML file) record set and update, insert or delete from the 1st record set (master db).
I would create the same index on both dataset to
insure that you have the same sort order then compare each record against the master db.
The best way would have some type of flag in the xml file that would identify what occurred, insert, update or delete.
Then you could just step through the xml dataset and based on the status of the flag perform the needed action on the master db.
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

swingflyAuthor Commented:
Yes, thats true, but can't you solve the problem by using updatebatch ?.. That would be a nice solution, but it doesn't seem to work.

Pesudo :
Temp openXML
Temp use ConnectionOpen
From what I understand ADODataSet.UpdateBatch is like transaction control. Where you can post all of your changes
at the same time or cancle them also. I'm not aware of any
replacement for TBatchMove from BDE that woks for ADO.
You might have to write you own.

Force Accepted

Community Support Moderator @Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.