[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ADOExpress problems !

Posted on 2001-07-02
6
Medium Priority
?
181 Views
Last Modified: 2010-04-06
Hi!

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()
  i+1
 list.next()
..
for i to i.length() i+1
SaveInXML.RecordList[i]

--- second bit.----

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

/ wr Henrik Franzen
0
Comment
Question by:swingfly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Accepted Solution

by:
bnemmers earned 200 total points
ID: 6245774
Try using the SaveToFile & LoadFromFile using an
ADODataSet. Here's some sample code.



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

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

end;

Good luck.
Bill
0
 

Author Comment

by:swingfly
ID: 6246211
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!
0
 
LVL 1

Expert Comment

by:bnemmers
ID: 6246819
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:swingfly
ID: 6247459
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
ConnectionOpen
Temp use ConnectionOpen
Temp.updatebatch
0
 
LVL 1

Expert Comment

by:bnemmers
ID: 6249526
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.

Bill
0
 

Expert Comment

by:SpideyMod
ID: 8280614
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question