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.
error in reading sql selection
-
- Fresh Boarder
- Posts: 4
- Joined: 20.04.2016, 13:02
error in reading sql selection
You do not have the required permissions to view the files attached to this post.
-
- Platinum Boarder
- Posts: 1918
- Joined: 17.01.2011, 14:17
Re: error in reading sql selection
Hello, which database do you use and which version of Delphi or Lazarus?
-
- Fresh Boarder
- Posts: 4
- Joined: 20.04.2016, 13:02
Re: error in reading sql selection
good morning, delphi XE3 + firebird
Re: error in reading sql selection
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;
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;