Subject | Re: [IBO] Raising the DefaultValues/LookupCombo issue again |
---|---|
Author | Geoff Worboys |
Post date | 2002-12-03T22:59:54Z |
It all comes down to what you understand as the meaning of "default"
and the meaning of a foreign key value.
At the client the default is the value applied when you first create
the record.
At the server the defined default is ONLY applied if you do not
specify a value on insert (if you specify NULL it is accepted).
Default is not related to whether whether a null is acceptable or
desirable or not (at the client or the server).
A foreign key value specifies a relationship. The only mechanism
for supporting "no relationed row exists" is a NULL. Hence the
operation of LookupCombo - which is designed for the maintenance
of foreign keys.
If you want different behaviour write it! And you are right, using
BeforePost events is inefficient and error prone. You should be
deriving your own components.
All serious developers should be prepared to derive their own
variation of components to introduce application specific behaviour.
Indeed I recommend that you start any big project by setting up your
own package of basic derivations so you can easily extend as and
when the requirement arises.
And if you truly want your database to be reliable and consistent
then you must be prepared to write triggers to enforce your rules.
Its a PITA I know, but without this your entire application is
resting on the assumption that no-one will ever access your data
from outside your client application - and this is not usually a
safe assumption.
--
Geoff Worboys
Telesis Computing
and the meaning of a foreign key value.
At the client the default is the value applied when you first create
the record.
At the server the defined default is ONLY applied if you do not
specify a value on insert (if you specify NULL it is accepted).
Default is not related to whether whether a null is acceptable or
desirable or not (at the client or the server).
A foreign key value specifies a relationship. The only mechanism
for supporting "no relationed row exists" is a NULL. Hence the
operation of LookupCombo - which is designed for the maintenance
of foreign keys.
If you want different behaviour write it! And you are right, using
BeforePost events is inefficient and error prone. You should be
deriving your own components.
All serious developers should be prepared to derive their own
variation of components to introduce application specific behaviour.
Indeed I recommend that you start any big project by setting up your
own package of basic derivations so you can easily extend as and
when the requirement arises.
And if you truly want your database to be reliable and consistent
then you must be prepared to write triggers to enforce your rules.
Its a PITA I know, but without this your entire application is
resting on the assumption that no-one will ever access your data
from outside your client application - and this is not usually a
safe assumption.
--
Geoff Worboys
Telesis Computing