EVariantBadVar:自升级到Delphi Seattle以来,TBytesField的变体类型无效

时间:2016-01-19 12:36:25

标签: delphi delphi-xe delphi-10-seattle

自从我从Delphi XE升级到Delphi Seattle后,当我尝试为EVariantBadVar分配值时,我得到TBytesField

procedure Test.SetHash(hash : TByteDynArray);
var
query : TAdoQuery;
a: TArray<byte>;
begin
query := ....
query.Sql.Text := 'SELECT [Key], [Hash] FROM [HashValues]...';
query.Insert();
a := TArray<byte>(hash);
// hash is from a webservice with type TByteDynArray
query.Fields[1].AsBytes := a; // here occurs the exception
query.Post();
...

相同的代码在Delphi XE中没有问题。

0 个答案:

没有答案