Posted by Met@ on August 29, 2002:

In Reply to: Delphi does not trap database error posted by Technics on August 29, 2002:

: I am using Delphi 6 to access MS access database. I used the OnPostError, OnEditError events, try....except sequence, and ApplicationEvent to trap data entries errors. The problem is that I am getting the default delphi EOle... exception error. Any ideas?

It don't know whether this is gonna help you or not, but I have had something like that yesterday. I was writing an application that calculates something. You have to fill in two numbers. I got my own warning when ONE of the two numbers was zero, but when both of them were zero, I got the Delphi error! I solved it by doing this:

try
begin
if ((InvoerLengte.Text <> '0') and (InvoerGewicht.Text <> '0')) then
begin
//blablablabla the rest of the code (calculation)
end;
end;
except
//blablabla

So you can basically trap the errors BEFORE you start to calculate or do something else...you know what I mean?
Hope this helps!

Met@


[ DelphiLand FAQ ] [ Delphi Tutorials ]