problem with TDateTimeField

edited 4:54PM in FastCube
I have problem reading DateTime values from our database, because fastcube tries to translate them from MSec to TDateTime - but in our database DateTime values are already stored as TDateTime.

function TPDateTimeArray.Hash(AValue: Pointer): Word;
var
T: TTimeStamp;
begin
T := MSecsToTimeStamp(PDouble(AValue)^);
// T := DateTimeToTimeStamp(PDouble(AValue)^);
// T.Time := 0; //??? ?­? ?¤?® ???«?? ?­???? ???
PDouble(AValue)^ := TimeStampToDateTime(T);
Result := Abs(PInt64(AValue)^ mod Frazm);
end;

in our case this would work:

function TPDateTimeArray.Hash(AValue: Pointer): Word;
begin
Result := Abs(PInt64(AValue)^ mod Frazm);
end;

Comments

  • edited March 2010
    Hi.

    Please write:
    -database type
    -dataset component
    -type of field in database
    -type of field component in Delphi for this field
    -Delphi version

    Oleg.
  • edited 4:54PM
    wrote: »
    Hi.

    Please write:
    -database type
    -dataset component
    -type of field in database
    -type of field component in Delphi for this field
    -Delphi version

    Oleg.

    Hi Oleg,

    thanks, I found the problem. The database is our own dbGonzales Database Server. DateTime Fields in the Database have the same format as the TDateTime type in Delphi (= Double). Because of that we don't need to convert from MSec to TImeStamp and from TimeStamp to TDateTime. This leeds to a wrong implementation of GetFieldData(Field, Buffer, NativeFormat) in the case of NativeFormat = true.

    FastCube is the first component we tested which called GetFieldData with NativeFormat= true directly.

    Sorry to bother you, with our own fault.

    Cheers,

    Adrian.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.