?
Solved

URGENT: raising an exception

Posted on 2003-02-20
11
Medium Priority
?
213 Views
Last Modified: 2010-04-04
var cds:TClientDataSet;
 ....
 try
   cds.Post;
 except
   HERE      (***)
 end;
 ....
 
 If Post has a error then the flow cotrol arrives
in module DBTables.pas and explicitely call this
 raise EDBEngineError.Create(ErrorCode);

How can I get this ErrorCode in my application
and do something HERE (***)
 
 thanks
0
Comment
Question by:sica79
[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
  • 2
  • 2
  • +5
11 Comments
 
LVL 8

Expert Comment

by:Cesario
ID: 7986932
Hi sica79,

try
  cds.Post;
except
  OE E: Exception do
   ShowMessage( E.Message);
end;

good luck

Cesario
0
 
LVL 8

Expert Comment

by:Cesario
ID: 7986933
try
 cds.Post;
except
 ON E: Exception do
   Begin
     ShowMessage( E.Message);
   End;

end;
0
 
LVL 9

Expert Comment

by:mocarts
ID: 7986953
var
  cds: TClientDataSet;
  i: integer;
begin
try
  cds.Post;
except
  on e: EDBEngineError do
  begin
    for i := 0 to e.ErrorCount -1 do
      if e.Errors[i].ErrorCode = CODE_TO_HANDLE then
        HandleThisErrorCode;
  end;
end;
end;

wbr, mo.
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.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 7987081
or use the onPostError-event instead
0
 

Author Comment

by:sica79
ID: 7992248
Hi men!

It's still doesn't work!
never reaches   on e: EDBEngineError
I've tried even on e: Exception thinking is more general
but doesn't work

??????

thanks anyway
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7992426
and again,
or use the onPostError-event instead
0
 

Author Comment

by:sica79
ID: 8007210
Hi world!

I did it!

I found the OnReconcileError event of
the ClientDataSet component.
This Event has a E: EReconcileError parameter
and i used  E.ErrorCode  to take my error !

thanks
0
 
LVL 9

Expert Comment

by:ITugay
ID: 8127325
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ/Refund
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ITugay
0
 

Expert Comment

by:CleanupPing
ID: 9317159
sica79:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9928752
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       PAQ and refund points
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9974929
PAQed, with points refunded (100)

Computer101
E-E Admin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
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
Course of the Month8 days, 3 hours left to enroll

765 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