cannot access field "MyField" as type float

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Zool1080
Posts: 8
Joined: Tue 04 Feb 2014 22:52

cannot access field "MyField" as type float

Post by Zool1080 » Tue 14 Aug 2018 07:53

VirsualQuery.fieldByName('MyField').ascurrency cause the error
cannot access field "MyField" as type float
the source of virsualQuery is TVirtualTable with field "MyField" of Currency Type
to reproduce the error :
>>> put TVirtualTable and TvirsualQuery on the form and link the virsualQuery with Virsualtable
>>> define New Field "MyField" of Type Currency in Virsualtable
>>> select "Myfield" and try to access it as Currency "select MyField form Virsualtable" >> VirsualQuery.fieldByName('MyField').ascurrency

i can access it as String >>> VirsualQuery.fieldByName('MyField').asstring
Thanks,
Ahmed

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

Re: cannot access field "MyField" as type float

Post by MaximG » Wed 15 Aug 2018 11:53

Please test the described behavior using the latest version of VirtualDAC 10.4.10 (13-Jul-2018). If the error is reproduced on this version of VirtualDAC, please compose and send us the source code of the test sample, execution of which causes the issue. This can be done using the e-support form https://www.devart.com/company/contactform.html

Zool1080
Posts: 8
Joined: Tue 04 Feb 2014 22:52

Re: cannot access field "MyField" as type float

Post by Zool1080 » Wed 15 Aug 2018 12:19

what is the version Included within Unidac 7.3.9?

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

Re: cannot access field "MyField" as type float

Post by MaximG » Wed 15 Aug 2018 13:55

UniDAC 7.3.9 includes VirtualDAC 10.4.10

Zool1080
Posts: 8
Joined: Tue 04 Feb 2014 22:52

Re: cannot access field "MyField" as type float

Post by Zool1080 » Wed 15 Aug 2018 14:54

Okey, so i am working with the latest version
To be more Precise :
i can access it as currency when the query is
select MyCurrencyField from VirtualTable
and can not when i use Coalesce or Sum, that is
select Coalesce(MyCurrencyField,0) as MyCurrencyField from VirtualTable
or
select Sum(MyCurrencyField) as MyCurrencyField from VirtualTable
is that make sense ?if no i can send you the Units

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

Re: cannot access field "MyField" as type float

Post by MaximG » Thu 16 Aug 2018 11:06

We reproduced the issue and fixed this error. The fix will be included in the next VirtualDAC build. As a workaround, we can send you a night VirtualDAC build including the required changes. For this, using e-support form ( https://www.devart.com/company/contactform.html ) provide us with your license number and IDE version you are interested in

Post Reply