?
Solved

TClientDataSet.ApplyUpdates

Posted on 2004-09-20
3
Medium Priority
?
865 Views
Last Modified: 2008-03-06
Hi.

I update some data using the TClientDataSet.ApplyUpdates(0) method (TClientdataSet is connected to a TDataSetProvider which is connected to a TQuery).  This method returns the number of errors that occured while executing.

My question is simple :  how can I know what error actually did occured ?

Thanks :)
0
Comment
Question by:qas
[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
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 12110008
do it like this:

  try
    ClientDataSet1.ApplyUpdates(0);
  except
    on E: Exception do
      begin
        MessageDlg(E.Message, mtError, [mbOK], 0);
        Exit;
      end;
  end;

  E.Message will give the exception error message, which is detailed error.
0
 

Author Comment

by:qas
ID: 12111472
Hi.

Thanks for the comment.

The thing is that ClientDataSet1.ApplyUpdates(0) is a function returning an integer which is the number of errors that occured while updating the dataset.  Though I haven't tried it yet, I do believe that the actual call of this method CAN raise an exception (like if the dataset is locked or unavailable) but that is not what I'm really looking for.

For example, lets say the function returns 3.  I want to know what actully are those 3 errors that occured.

Thanks :)
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 200 total points
ID: 12112631
in your case "ClientDataSet1.ApplyUpdates(0);" you send 0 for MaxErrors. This means if there is more than 0 errors, for e.g. 1 - you will go into the "except" block. There you have E.Message.

If you have more than 1 errors, you have to work with Reconcile method. Handle the errors in OnReconcileError.
0

Featured Post

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.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

777 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