Home arrow Delphi-Kylix arrow Page 4 - Briefcase Applications Explained
DELPHI-KYLIX

Briefcase Applications Explained


If you have remote users connecting to your database server who need to make changes to the data, you might want to set up a briefcase application, depending on what exactly they do with the data. This article will help you set one up using Delphi, MySQL, and an XML file.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
October 10, 2006
TABLE OF CONTENTS:
  1. · Briefcase Applications Explained
  2. · The Database Server
  3. · Building the Application
  4. · Applying Changes to the Data

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Briefcase Applications Explained - Applying Changes to the Data
(Page 4 of 4 )

So far we have covered how to retrieve data from the server, and how to store and make changes to that data. The final thing we need to do is apply those changes back to the  server. We do this by simply calling the "applybatch()" function. So, double click on the button with the caption "Apply changes to Server" and add the following code:

procedure TForm2.btnapplyClick(Sender: TObject);
begin
// Connect to MySQL, load savedata.xml and send changes to
MySQL
     form1.q.Connection := form1.ADOConnection1;
      form1.q.UpdateBatch(arAll);
end;

This code connects to the server:

form1.q.Connection := form1.ADOConnection1;

Then calls the "UpdateBatch(arAll)" command:

form1.q.UpdateBatch(arAll);

Which updates the server with the changes.

Conclusion

There are some things that I have not covered in this article, such as conflict resolution. For example I did not address the question of how to detect if a record has been changed by someone else before you apply your updates. I've not experimented enough to work that out yet. Ultimately, you will have to decide what you want to do in those circumstances, but at the end of the day, the records will be overwritten one way or the other.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials