#1 2014-05-19 14:53:51

fabioquestor
Member
From: Chapecó, SC, Brasil
Registered: 2014-05-19
Posts: 13
Website

FireDac Problem with TDateTime and double

type
  TSQLmORMotTest = class(TSQLRecord)
  private
    fLAT: double;
    fDataInicio: TDateTime;
  published
    property LAT: double read fLAT write fLAT;
    property DataInicio: TDateTime read fDataInicio write fDataInicio;
  end;

...

use: TSQLDBFireDACConnectionProperties.Create(FIREDAC_PROVIDER[dFirebird],...);

...

var
  AmORMotTestAdd,
  AmORMotTestRet: TSQLmORMotTest;

begin

  AmORMotTestAdd := TSQLmORMotTest.Create;

  AmORMotTestAdd.LAT := 987.321;
  AmORMotTestAdd.DataInicio := EncodeDate(2014, 10, 7);

  AID := DBServer.Add(AmORMotTestAdd, True);

  AmORMotTestRet := TSQLmORMotTest.Create(DBServer, AID);

  CheckEquals(ObjectToJSON(AmORMotTestAdd), ObjectToJSON(AmORMotTestRet)); //error

end;

Solution:

{ SynDBDataset.TSQLDBDatasetStatementAbstract }

function TSQLDBDatasetStatementAbstract.ColumnTypeNativeToDB(aNativeType: TFieldType): TSQLDBFieldType;
begin
  ...
    ftSingle:
      result := SynCommons.ftCurrency;
    ftTimeStamp:
      result := SynCommons.ftDate;
  ...
end;

Offline

#2 2014-05-19 18:37:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: FireDac Problem with TDateTime and double

Should be fixed now by http://synopse.info/fossil/info/7e3ff4ad37

Thanks a lot for the feedback!
smile

Offline

Board footer

Powered by FluxBB