View Issue Details

IDProjectCategoryView StatusLast Update
0005887JEDI VCL00 JVCL Componentspublic2012-09-10 14:15
ReporteraltaveronAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.40 
Target VersionFixed in Version3.46 
Summary0005887: TJvDBGrid displays NULL in DateTime field as 30.12.1899
Description1. 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.
TagsNo tags attached.

Relationships

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

Activities

altaveron

2012-05-21 15:47

reporter   ~0019771

May be caused by "fix" of issue#5581.

altaveron

2012-05-21 16:25

reporter   ~0019772

NULL date should be set on code or by SQL query. Not by user input on the grid.

2012-05-21 16:27

 

issue.png (6,705 bytes)
issue.png (6,705 bytes)

altaveron

2012-05-21 16:50

reporter   ~0019773

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!

altaveron

2012-05-21 16:54

reporter   ~0019774

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;

altaveron

2012-05-21 16:57

reporter   ~0019775

The same issue: 0005804

obones

2012-06-12 15:53

administrator   ~0019923

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