Subject Re: [ib-support] define date
Author Daniel Rail
At 22/03/2002 01:40 PM, you wrote:
>Hi,
>I tried everything, assign a null value onNewRecord event, did not do it.
>this is what I have tried,
>
>CREATE DOMAIN T_DATE2 AS DATE DEFAULT NULL;
>CREATE TABLE INVOICES (
> ORDDATE T_DATE2,
>
>and this, without a domain
>CREATE TABLE INVOICES (
> ORDDATE DATE,
>
>with dbnavigator I insert a record. when I post the record get the error;
>EDataBaseError "field ORDDATE must have a value"
>if I give it a value no problem, but what am I doing wrong, if I don't
>want to give it a value??
>D5,IBO,FB1

The message that you are referring to is generated by Delphi, not Firebird
or Interbase.

Is the field flagged as Required=True somewhere in your code or field
properties in the DFM? If you are using persistent fields, it might be
there. A property does exist for a persistent field to say that it is
required, even if it's not defined as such at the database level. This
happened to me before, especially when a field was defined as not null in
the database then changed to allow nulls, but the property Required in the
persistent fields was still set to True. I had to manually change them to
False. I know that this is one area of the code that you might not think
of looking at, I know I didn't at the time, it took me a few days to figure
it out.

Hope this helps.


Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)