#1 2017-02-20 19:10:44

island
Member
Registered: 2017-02-20
Posts: 10

Oracle Date Field SynVirtualDataSet invalid timestamp

Hi,

Base is Sample 17
mORMotVCLUnit
I get an invalid timestamp error if e try to show a datefield

procedure TForm1.FormCreate(Sender: TObject);
begin
  fProps := TSQLDBOracleConnectionProperties.Create('dbname','','user','pwd');
end;
...
var
  t : TDateTime;
...

      ds1.DataSet := TSynDBSQLDataSet.Create(self);
      TSynDBSQLDataSet(ds1.DataSet).Connection := fProps;
      TSynDBSQLDataSet(ds1.DataSet).CommandText := 'select DATUM from mtest';
      ds1.DataSet.Open;
      ds1.DataSet.First;
      while not ds1.DataSet.Eof do
      begin
	  //if i use in SynVirtualDataSet an old version
          //function TSynVirtualDataSet.GetFieldData(Field: TField; Buffer: Pointer): Boolean;
          //...
          //ftDateTime:
          //  DateTimeToNative(Field.DataType,PDateTime(Data)^,Dest^); 
	  //then no error hier
  	   t := ds1.DataSet.FieldByName('DATUM').AsDateTime; 
	   
	   // but if i use in SynVirtualDataSet the last version
           //ftDateTime:
	   //    TDatetimeRec(Dest^) := PDateTime(Data)^; 
	   // i get an error hier <<< invalid timestamp 
	    t := ds1.DataSet.FieldByName('DATUM').AsDateTime; 
       st := DateToStr(t);
       if st ='' then;
       ds1.DataSet.Next;
      end;

Hope you can understand the problem

Thank you.

Offline

#2 2017-04-26 03:08:10

joananjr
Member
From: Brasil
Registered: 2017-04-24
Posts: 8

Re: Oracle Date Field SynVirtualDataSet invalid timestamp

I got the same problem.

Offline

#3 2017-07-25 19:22:28

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

Re: Oracle Date Field SynVirtualDataSet invalid timestamp

Please try https://synopse.info/fossil/info/d171280064

I've reverted to the previous version, which was reported to work - but for EMartin...

Offline

Board footer

Powered by FluxBB