Subject Re: [IBO] Still little problems
Author Helen Borrie
At 03:29 PM 19/03/2003 +0100, you wrote:
>oops, sorry, I will post TestCase.zip to the Files area.
Salvatore,
There's a reason for everything... :-)

Here's what I found in your qryEvents dataset:

InsertSQL.Strings = (
'INSERT INTO EVENTS('
' DESCRIPTION,'
' EXPIRY_DATE,'
' ALERT_DAYS_BEFORE,'
' ALERT_DAYS_AFTER,'
' EVENT_ENABLED)'
'VALUES ('
' :DESCRIPTION,'
' :EXPIRY_DATE,'
' :ALERT_DAYS_BEFORE,'
' :ALERT_DAYS_AFTER,'
' :EVENT_ENABLED)')

Ok, now, what you achieve here is to force the current value of
:DESCRIPTION into the VALUES() list of the insert, thereby making it "a
value" rather than a "non-value". So - because you forced the value-list
to take this "value" of <whatever> (in this case, an empty string),
BLANKISNULL is not applied.

The value of the property BLANKISNULL isn't changed by applying an explicit
value.

You can fix this (if it's a genuine problem) in a number of ways.

1. Remove the XxxxxxSQL properties and let IBO do what you have set it up
to do. Since there seems to be nothing special about these XxxxxxSQL
statements, that will be your best remedy.
or
2. (messy) Apply some code to the BeforePost event, along the lines of

with Dataset do
if State in [dssInsert, dssEdit] then
if Trim(ParamByName('Description').AsString) = EmptyStr then
ParamByName('Description').Clear;

But I'm still dense as to why you want to defer validation until a Post
fails. It would be better in all ways to make the exception occur during
CheckRequired and have the user correct the problem *before* the Post
attempt (a client-to-server operation) occurs and fails.

Helen