Page 1 of 1

error in reading sql selection

Posted: 21.09.2018, 22:40
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.

Re: error in reading sql selection

Posted: 22.09.2018, 23:24
by marsupilami
Hello, which database do you use and which version of Delphi or Lazarus?

Re: error in reading sql selection

Posted: 24.09.2018, 11:37
by juliocjrodrigues
good morning, delphi XE3 + firebird

Re: error in reading sql selection

Posted: 20.11.2018, 21:34
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;