error in reading sql selection

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
juliocjrodrigues
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 20.04.2016, 13:02

error in reading sql selection

Post by juliocjrodrigues »

Hello,
after installing version 7.2.4, I started to receive error messages of integer values and floating nulls as the images because the return of the selection contains values or in some cases contains zero as default.
You do not have the required permissions to view the files attached to this post.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: error in reading sql selection

Post by marsupilami »

Hello, which database do you use and which version of Delphi or Lazarus?
juliocjrodrigues
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 20.04.2016, 13:02

Re: error in reading sql selection

Post by juliocjrodrigues »

good morning, delphi XE3 + firebird
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 765
Joined: 18.11.2018, 17:37
Location: Hungary

Re: error in reading sql selection

Post by aehimself »

Hello,

The thread is quite old but there were no answers so... "A read of address" exception with a low value usually means a reference to a null object.
You did not include many details (like if there is a value in the database or not) and I assume the same code was working with pre 7.2.4.

If this is the case - I'm no expert but - I'd say something was changed in how the component handles null values. Fortunately the fix seems to be quite easy:
If Not q1.FieldByName('tolhex').IsNull Then toleranciaextra := q1.FieldByName('tolhex').AsInteger
Else toleranciaextra := some_default_value;

When I had to work with variant types, I created a simple error wrapper. It's not elegant, but gets the job done - maybe you can try the same?

Try
toleranciaextra := q1.FieldByName('tolhex').AsInteger;
Except
toleranciaextra := some_default_value;
End;
Post Reply