Subject | Any answer?... Also, can you add this bugfix? |
---|---|
Author | IBM T |
Post date | 2001-10-28T07:23:24Z |
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
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