TObjectDataset and enumerated type property

Issue #224 resolved
Jacek Laskowski created an issue

I have class that have enumerated type fields:

TConditionType = (GreaterThan, GreaterOrEqual, Equal, LessThan, LessOrEqual, NoSingnificance);

  {$M+}
  TProductCondition = class
  private
    fDateCondition: TConditionType;
    fProductReleaseDate: TDateTime;
  public
    constructor Create();
    destructor Destroy(); override;
  published
    property DateCondition: TConditionType read fDateCondition write fDateCondition;
    property ProductReleaseDate: TDateTime read fProductReleaseDate write fProductReleaseDate;
  end;
  {$M-}

I use IList<TProductCondition> as data source for TObjectDataset. But when I connect dataset to datasource and dbgrid I get access violation. See screenshots from debug session:

DateCondition field is enumerated type, TObjectDataset create ftWideString field for it. But when detect varInt64 type then convert value to Int64:

Ashampoo_Snap_2017.01.29_20h38m03s_005_.png

Next try cast Int64 value to unicode string:

Ashampoo_Snap_2017.01.29_20h40m17s_006_.png

and raise access violation:

Ashampoo_Snap_2017.01.29_20h41m40s_007_.png

Comments (2)

  1. Log in to comment