Subject | Re: [IBO] Event Misfiring |
---|---|
Author | Helen Borrie |
Post date | 2001-03-01T23:12:02Z |
At 12:59 PM 01-03-01 -0800, you wrote:
If you want to stay with Field.Prop, add this:
procedure TdmVessels.dsVNotDataChange(Sender: TIB_StatementLink;
Statement: TIB_Statement; Field: TIB_Column);
begin
if not Statement.Prepared then
Statement.Prepare;
ShowMessage('dsVNotDataChange: ' + Field.FieldName);
end
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Greetings,The Fields[] array is created when the dataset is prepared. You get the AV if you try to refer to it before it is instantiated. The safer way to go is to use FieldByName, as it automatically tests Prepared and does the Prepare for you if necessary.
>
>The following event throws an AV w/out the first line of code:
>
>procedure TdmVessels.dsVNotDataChange(Sender: TIB_StatementLink;
> Statement: TIB_Statement; Field: TIB_Column);
>begin
> If NOT Assigned(Field) then Exit;
> ShowMessage('dsVNotDataChange: ' + Field.FieldName);
>end;
>
>
>Seems like this event is firing way too early, even before the Field has
>been assigned?
>
>Comments?
>
>Kevin
If you want to stay with Field.Prop, add this:
procedure TdmVessels.dsVNotDataChange(Sender: TIB_StatementLink;
Statement: TIB_Statement; Field: TIB_Column);
begin
if not Statement.Prepared then
Statement.Prepare;
ShowMessage('dsVNotDataChange: ' + Field.FieldName);
end
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________