Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005887 [JEDI VCL] 00 JVCL Components major always 2012-05-21 15:43 2012-09-10 14:15
Reporter altaveron View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.40
Summary 0005887: TJvDBGrid displays NULL in DateTime field as 30.12.1899
Description 1. Open TADOQuery with NULL in DateTime field.

TJvDBGrid displays NULL in DateTime field as 30.12.1899.

TJvDBGrid should display NULL as empty field in DateTime field.
Additional Information
Tags No tags attached.
Attached Files png file icon issue.png [^] (6,705 bytes) 2012-05-21 16:27

- Relationships
has duplicate 0005882resolvedobones AssignRecord is does not copy NULL values 
related to 0005804resolvedobones TJvMemory LoadFromDataset does not copy Null Value 

-  Notes
(0019771)
altaveron (reporter)
2012-05-21 15:47

May be caused by "fix" of issue#5581.
(0019772)
altaveron (reporter)
2012-05-21 16:25

NULL date should be set on code or by SQL query. Not by user input on the grid.
(0019773)
altaveron (reporter)
2012-05-21 16:50

Sorry! The issue caused by the following line on the source code:

JvMemoryData1.LoadFromDataSet(JvAdoQuery1, 0, lmAppend);

LoadFromDataSet copies NULL to 30.12.1899 in date field.

THIS IS LoadFromDataSet ISSUE!
(0019774)
altaveron (reporter)
2012-05-21 16:54

The issue on the code:


procedure AssignRecord(Source, Dest: TDataSet; ByName: Boolean);
var
  I: Integer;
  F, FSrc: TField;
begin
  if not (Dest.State in dsEditModes) then
    _DBError(SNotEditing);
  if ByName then
  begin
    for I := 0 to Source.FieldCount - 1 do
    begin
      F := Dest.FindField(Source.Fields[I].FieldName);
      if (F <> nil) and (F.DataType <> ftAutoInc) then
      begin
        case F.DataType of
           ftString: F.AsString := Source.Fields[i].AsString;
           ftInteger: F.AsInteger := Source.Fields[i].AsInteger;
           ftBoolean: F.AsBoolean := Source.Fields[i].AsBoolean;
           ftFloat: F.AsFloat := Source.Fields[i].AsFloat;
           ftCurrency: F.AsCurrency := Source.Fields[i].AsCurrency;
           ftDate: F.AsDateTime := Source.Fields[i].AsDateTime;
           ftDateTime: F.AsDateTime := Source.Fields[i].AsDateTime;
        else
           F.Value := Source.Fields[I].Value;
        end;
      end;
    end;
  end
  else
  begin
    for I := 0 to Min(Source.FieldDefs.Count - 1, Dest.FieldDefs.Count - 1) do
    begin
      F := Dest.FindField(Dest.FieldDefs[I].Name);
      FSrc := Source.FindField(Source.FieldDefs[I].Name);
      if (F <> nil) and (FSrc <> nil) and (F.DataType <> ftAutoInc) then
      begin
        case F.DataType of
           ftString: F.AsString := FSrc.AsString;
           ftInteger: F.AsInteger := FSrc.AsInteger;
           ftBoolean: F.AsBoolean := FSrc.AsBoolean;
           ftFloat: F.AsFloat := FSrc.AsFloat;
           ftCurrency: F.AsCurrency := FSrc.AsCurrency;
           ftDate: F.AsDateTime := FSrc.AsDateTime;
           ftDateTime: F.AsDateTime := FSrc.AsDateTime;
        else
           F.Value := FSrc.Value;
        end;
      end;
    end;
  end;
end;
(0019775)
altaveron (reporter)
2012-05-21 16:57

The same issue: 0005804
(0019923)
obones (administrator)
2012-06-12 15:53

This is now fixed in SVN

- Issue History
Date Modified Username Field Change
2012-05-21 15:43 altaveron New Issue
2012-05-21 15:47 altaveron Note Added: 0019771
2012-05-21 16:25 altaveron Note Added: 0019772
2012-05-21 16:27 altaveron File Added: issue.png
2012-05-21 16:50 altaveron Note Added: 0019773
2012-05-21 16:54 altaveron Note Added: 0019774
2012-05-21 16:57 altaveron Note Added: 0019775
2012-06-06 09:49 obones Relationship added related to 0005804
2012-06-11 17:34 obones Status new => feedback
2012-06-11 17:35 obones Relationship added has duplicate 0005882
2012-06-12 15:53 obones Note Added: 0019923
2012-06-12 15:53 obones Status feedback => resolved
2012-06-12 15:53 obones Fixed in Version => Daily / SVN
2012-06-12 15:53 obones Resolution open => fixed
2012-06-12 15:53 obones Assigned To => obones
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46
2013-08-06 21:01 altaveron Issue Monitored: altaveron
2013-08-06 21:02 altaveron Issue End Monitor: altaveron


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker