You are not logged in.
I have same problem with:
* ToDataSet, ToClientDataSet when read data from Firebird 2.1
Sorry form bad english !
See image !
https://drive.google.com/open?id=0Bzdd_ … 0p5azZ2aDg
Congratulation for the great mormot project !
Offline
I have the same issue with MySQL + ZEOS, assigning TSynDBDataSet created form TSQLDBStatement with DATETIME fields to TDataSource connected with grid causes "Is not valid timestamp" exception.
Offline
i got the same problem
Offline
i got today 27 apr 2017 the lastest version of mormot and the error raised agan.
Offline
I tested with firebird and mysql sql. Both raise the same error. I think that's this error in SynDbZeos...
Offline
Well, today I tested with the sqlite and I use to connect
Props := TSQLDBSQLite3ConnectionProperties.Create('testedbsqlite.db3', '', '', '' );
then a single sql in memo end run this code
datasource.dataset := ToDataSet(Self, Props.Execute(Memo1.Text, []));
If no date, datetime or time fields at table run ok. But if existe any date, datetime and time field the error raise at the same form that raise in firebird and mysql using zeos.
I think new that this error is in ToDateSet procedure.
But I knew a person in facebook that use mormot than I ask if he help-me with this issue. I send to him my source exemplo and,
For my surprise, the code runs nice.
I create a new virtual machine with Windows, i installed delphi and mormot and zeos. But the error raise agan im my new machine.
That´s crucial tu me for use mormot becouse i will don´t use ORM i only need to user direct acess for firebrd, sqlite or mysql
Offline
I maked more tests. I return to use mysql and i verify that even using SQLDBRows.Step the contente of columns of type DateTime retrive a blank value. At this tima i did not use ToDataSet procedure. I.E. The problem problably do not reside in ToDataSet procedure.
Offline
SynVirtualDataSet.pas
+Add
function DateTimeToNative(DataType: TFieldType; Data: TDateTime): TDateTimeRec;
var
TimeStamp: TTimeStamp;
begin
TimeStamp := DateTimeToTimeStamp(Data);
case DataType of
ftDate: Result.Date := TimeStamp.Date;
ftTime: Result.Time := TimeStamp.Time;
else
Result.DateTime := TimeStampToMSecs(TimeStamp);
end;
end;
...
ftDate, ftTime:
if PDateTime(Data)^=0 then
result := false else begin
TS := DateTimeToTimeStamp(PDateTime(Data)^);
if (TS.Time<0) or (TS.Date<=0) then
result := false else // matches ValidateTimeStamp() expectations
case Field.DataType of
ftDate: PDateTimeRec(Dest)^.Date := TS.Date;
ftTime: PDateTimeRec(Dest)^.Time := TS.Time;
end;
end;
ftDateTime:
// Change to this.
TDateTimeRec(Dest^) := DateTimeToNative(Field.DataType, TDateTime(Data^));
//PDateTimeRec(Dest)^.DateTime := PDateTime(Data)^;
Offline
Well, i maked tests with this modifications. Works almost well.
The error no more raise, the contente of TDateField are ok. But the content of TTimeFields apears with blank Date together. If we use editmask property at TTime field raise the error invalid timefield becouse the delphi dont expect these date together.
But i'm happy. Plase qq if you can correct this on yor code. Thakss a lot.
Offline
I will try to handle it, but I believe that ab is already being processed
Offline
ab
i've the 1.18.2975 version !
Offline
Please try https://synopse.info/fossil/info/d171280064
I've reverted to the previous version, which was reported to work - but for EMartin...
Offline
Please try https://synopse.info/fossil/info/d171280064
I've reverted to the previous version, which was reported to work - but for EMartin...
Offline
Oh thank you
Offline