TVirtualTable and TVariantField

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
serpan
Posts: 2
Joined: Wed 16 May 2018 09:18

TVirtualTable and TVariantField

Post by serpan » Wed 16 May 2018 09:52

Hello,

I am using UniDAC version 7.2.7 for Delphi XE5 Professional.

I need to create fields of type Variant in the component TVirtualTable:

Code: Select all

  VirtualTable1.FieldDefs.Add('id', ftVariant);
  VirtualTable1.FieldDefs.Add('name', ftVariant);
However, when I access them by property AsVariant, I get error: Access violation...:

Code: Select all

  VirtualTable1.Append;
  VirtualTable1.FieldByName('id').AsVariant := '1';
  VirtualTable1.FieldByName('name').AsVariant := 'String 1';
  VirtualTable1.Post;
Property AsString is works.

Code: Select all

  VirtualTable1.Append;
  VirtualTable1.FieldByName('id').AsString := '1';
  VirtualTable1.FieldByName('name').AsString := 'String 1';
  VirtualTable1.Post;
How can I use the AsVariant property?
Thank you very much.

Sergey.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: TVirtualTable and TVariantField

Post by ertank » Wed 16 May 2018 21:39

Hello,

That should be

Code: Select all

VirtualTable1.FieldByName('name').Value := 'String 1';

serpan
Posts: 2
Joined: Wed 16 May 2018 09:18

Re: TVirtualTable and TVariantField

Post by serpan » Thu 17 May 2018 03:11

Hello,
VirtualTable1.FieldByName('name').Value := 'String 1';
Did not help.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TVirtualTable and TVariantField

Post by MaximG » Thu 17 May 2018 13:10

Thank you for the information. We have reproduced the problem and fixed the bug. The fix will be included in the next UniDAC build. Currently, we can send you a night build of UniDAC with the fix. For this, please specify your license number and the exact version of Delphi you are using via the e-support form ( https://www.devart.com the "Support"\"Request Support" menu)

Post Reply