Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

URGENT: raising an exception

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
sica79
Asked:
sica79
  • 2
  • 2
  • 2
  • +5
1 Solution
 
CesarioCommented:
Hi sica79,

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

good luck

Cesario
0
 
CesarioCommented:
try
 cds.Post;
except
 ON E: Exception do
   Begin
     ShowMessage( E.Message);
   End;

end;
0
 
mocartsCommented:
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
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.

 
kretzschmarCommented:
or use the onPostError-event instead
0
 
sica79Author Commented:
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
 
kretzschmarCommented:
and again,
or use the onPostError-event instead
0
 
sica79Author Commented:
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
 
ITugayCommented:
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
 
CleanupPingCommented:
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
 
kacorretiredCommented:
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
 
Computer101Commented:
PAQed, with points refunded (100)

Computer101
E-E Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now