Subject Re: [IBO] Any answer?... Also, can you add this bugfix?
Author Jason Wharton
I've tried to duplicate this bug but I am unable to.
Are you doing anything special?
I was thinking that a check for FieldKind fkData would be a good way to
isolate this.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "IBM T" <vatt@...>
Newsgroups: egroups.ibobjects
To: <IBObjects@yahoogroups.com>
Sent: Sunday, October 28, 2001 12:23 AM
Subject: [IBO] Any answer?... Also, can you add this bugfix?


> Hi,
>
> The TIBODataset throws an exception when we have a call of the InitFields
> with design-time fields which aren't in the table (ie. client-calculated
> fields, lookup fields). The code:
>
>
> procedure TIBODataset.InitFields;
> var
> ii: integer;
> tmpCol: TIB_Column;
> tmpField: TField;
> begin
> for ii := 0 to FieldCount - 1 do
> begin
> tmpField := Fields[ii];
> tmpCol := InternalDataset.Fields.BySQLNo( tmpField.FieldNo - 1 );
> <--~------- exception here when tmpField.FieldNo = -1
> if tmpField.FieldName = tmpCol.BDEFieldName then
> begin
> ...
>
> The fix, IMHO, is quite obvious. A solution:
>
> procedure TIBODataset.InitFields;
> var
> ii: integer;
> tmpCol: TIB_Column;
> tmpField: TField;
> begin
> for ii := 0 to FieldCount - 1 do
> begin
> if Fields[ii].FieldNo < 1 then Continue; <--~------- the line which
> should be added
> tmpField := Fields[ii];
> tmpCol := InternalDataset.Fields.BySQLNo( tmpField.FieldNo - 1 );
> if tmpField.FieldName = tmpCol.BDEFieldName then
> begin
> ...
>
> For these small suggestions, please tell me if I can count on them to
> contiune my applications
>
> HTH