madorin / fibplus

FibPlus Library for Delphi and C++Builder. Data access components for Firebird & Interbase.
164 stars 57 forks source link

Fix field list in Delphi < XE6 not updating after CloseOpen #58

Open EchseKuhTiere opened 2 years ago

EchseKuhTiere commented 2 years ago

Reproduced it in Delphi 7 with fibPlus 7.6 using the TpFIBDataSet component

procedure testCloseOpen();
begin
  with FibDataSet do
  begin
    Close;
    SQLs.SelectSQL.Text := 'select id, name, age from table';
    CloseOpen;
  end;
end;

procedure testOpen();
begin
  with FibDataSet do
  begin
    Close;
    SQLs.SelectSQL.Text := 'select id, name from table';
    Open;
  end;
end;

procedure main();
begin
  testCloseOpen;
  testOpen; // error: field 'age' not found
end;

I guess when 'DefaultFields' got deprecated since Delphi XE6 the propery in FIBDataSet was renamed to remove the reference. It needs to be restored for old Delphi versions.

madorin commented 8 months ago

@EchseKuhTiere , it seems the entire property and the related GetDefaultFields function should be removed completely in latest Delphi versions. Can you check, please, if the issue is fixed in this branch https://github.com/madorin/fibplus/compare/58-default-fields Unfortunately, I don't have an older Delphi version installed Many thanks,

EchseKuhTiere commented 2 months ago

@madorin Sorry for the late reply. It's working but there's now another incompatibility for Delphi 7 due to this change: #73

Coming from TFIBWideStringField.GetAsString

    Result := inherited; // [Error] FIBDataSet.pas(2018): Incompatible types