Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How i can catch Edbediterror with message 'invalid input value'?

Posted on 2003-02-21
6
Medium Priority
?
1,441 Views
Last Modified: 2008-02-26
dear friends,
i am using delphi5 & i had set a date's editmask as !90/90/0000;1;
when user inputs a value & if he suddenly exit without entering full date,
there is a EdbEditErrore with message' invalid input value'.
I want to catch this error and display my own messagebox, How can i do this?

Thanking you,

Rajkiran Bilolikar.

0
Comment
Question by:Rajkiran
[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
6 Comments
 
LVL 3

Accepted Solution

by:
LukA_YJK earned 400 total points
ID: 7998084
There are some events OnEdit/PostError in TDataSet, are not there? Hope it will work...
0
 
LVL 22

Assisted Solution

by:Mohammed Nasman
Mohammed Nasman earned 400 total points
ID: 7998118
Hello

  Catch that error in Application.OnException, in this way, you can catch it even if you don't use database with your mask

Here's an example

TForm1 = class(TForm)
  .....
  private
    procedure MyException(Sender: TObject; E: Exception);
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnException := MyException;
end;

procedure TForm1.MyException(Sender: TObject; E: Exception);
const
  mskDateError = 'Invalid input value.  Use escape key to abandon changes';
begin
  if E.Message = mskDateError then
    MessageDlg('You should enter valid date',mtError,[mbYes],0);

end;

Best regards
Mohammed Nasman
0
 

Expert Comment

by:CleanupPing
ID: 9317126
Rajkiran:
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 22

Expert Comment

by:Mohammed Nasman
ID: 9387665
spilt points between LukA_YJK and me
0
 
LVL 10

Expert Comment

by:kacor
ID: 9948139
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:
       to split points between LukA_YJK and mnasman
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

721 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