Subject Re: [IBO] TIB_DataSource.onDataChange
Author Paul Vinkenoog
Hello Ulrich,

> Now I don't have any access violations any longer, but my code is
> still not working :-(
>
> with :
>
> procedure IB_DataSourceDataChange(Sender: TIB_StatementLink;
> Statement: TIB_Statement; Field: TIB_Column);
> begin
> if (Field<>NIL and Field.FieldName='myField') then...
>
> end;
>
> these condition seems to be NEVER true !!??

Did you define myField case-sensitively like this:

create table ThisTable
(
"myField" char( 8 ), // or whatever type
...
)

or case-insensitively:

create table ThisTable
(
myField char( 8 ), // or whatever type
...
)

In the latter case, the field name is stored in the database in
all-caps, so you have to test if Field.FieldName = 'MYFIELD'.

If you're not sure, test if UpperCase( Field.FieldName ) = 'MYFIELD'.

Or: if AnsiCompareText( Field.FieldName, 'myField' ) = 0.


> More than this. If I try to look which Fields are passing through
> with:
>
> if Field<>NIL then showMessage(Field.FieldName);
>
> nothing happens. Strange.

Are you sure the handler is still called at all? Maybe you could add
"... else ShowMessage( 'Field is nil' )" and see what happens.


Greetings,
Paul Vinkenoog