Board index » delphi » Entering date in a TDBEdit = EConvertError

Entering date in a TDBEdit = EConvertError

Hi All,

I'm sure the answer to this one is simple, but I can't seem to work it out.

I have a setup a form with a TTable connected to a paradox db with a
TDataSource.  I use a TDBEdit to access a date field in my table.

Whenever I enter new data in the field I get an EConverError exception
telling me that the date I have entered is invalid e.g. '12-Oct-99' is said
to be an invlaid date and this is that exact date format the edit control is

I have my short date format (Control Panel) set to 'dd-MMM-yy'.

I need my users to be able to enter dates in what ever format is set in the
Control Panel.

Does the Delphi TDBEdit only accept dates in a mm/dd/yy format?
Do I need to add some sort of date conversion routine in an event somewhere?

Any ides/solutions very welcome.

Best regards,

Dean Van Es


Re:Entering date in a TDBEdit = EConvertError


TwoDigitYearCenturyWindow := 50;
ShortDateFormat := 'dd/mm/yyyy';

Somewhere in the OnCreate event of your main form

Other Threads