Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'GetCalcFields' not found in base class Error

type
  TCDSWithRecalc = class(TClientDataset)
  public
    procedure GetCalcFields(Buffer: PChar); override;
  end;

procedure TCDSWithRecalc.GetCalcFields(Buffer :PChar);
begin
  inherited GetCalcFields(Buffer);
end;

E2137 Method 'GetCalcFields' not found in base class.

I don't understand what this error is. can you help?

like image 239
Gültekin Avatar asked Nov 17 '25 14:11

Gültekin


1 Answers

You don't say which Delphi version you are using, but the type declaration of the Buffer parameter was changed from the original (D7 and before) PChar to TRecBuf in the modern (Unicode) versions. So, you you need to change your declaration of TCDSWithRecalc

to

type
  TCDSWithRecalc = class(TCustomClientDataset)
  public
    procedure GetCalcFields(Buffer: TRecBuf); override;
  end;

[...]

procedure TCDSWithRecalc.GetCalcFields(Buffer : TRecBuf);
begin
  inherited GetCalcFields(Buffer);
end;

In Delphi 10.4.2, the compiler reports an additional error with your version of the declaration

[dcc32 Error] cds1u.pas(41): E2250 There is no overloaded version of 'GetCalcFields' that can be called with these arguments

which is true.

like image 197
MartynA Avatar answered Nov 19 '25 08:11

MartynA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!