Subject Any answer?... Also, can you add this bugfix?
Author IBM T
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