Function IsNull returns wrong value

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ArizmendiTeam
Posts: 10
Joined: Fri 13 Jul 2018 18:36

Function IsNull returns wrong value

Post by ArizmendiTeam » Thu 26 Jul 2018 15:11

Hi,

I'm using a UniDbGrid that is related to an Interbase table. The UniDbGrid columns show the information of the fields in the table. When inserting a record in that grid and before inserting itself into the interbase table, a series of validations is made, one of those validations is that a field (In this case, Amount From) can be loaded amounts greater than or equal to 0 and is correct. These validations are executed before registering the record in the table

If TableName.FieldByName ('AmountFrom'). IsNull then
ShowMessage ("You must enter an amount greater than or equal to 0")

The problem is that if I charge amount = 0 the, when doing the previous validation I get the message that I must enter an amount because the IsNull function returns TRUE. This is not correct since the field has the value 0 and therefore is not null. If 0.01 is reported (or any value other than 0) the message does not appear because the IsNull function returns FALSE.

In this case I am not using querys but I use the TIBCTable and TIBCDataSource components.

Any idea how to fix this?.

Thanks in advance

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Function IsNull returns wrong value

Post by ViktorV » Fri 27 Jul 2018 08:06

Unfortunately we could not reproduce the issue on the latest IBDAC 6.2.8 version.
Perhaps, this issue occurs due to using a third-party component (UniDBGrid).
Please try reproducing the issue by replacing UniDBGrid with the standard DBGrid.
Also make sure that the issue is reproduced on the latest IBDAC 6.2.8.
If it is, please compose a small sample demonstrating the described behavior and send it using the contact form https://devart.com/company/contactform.html, including scripts for creating database objects. Also, please specify the used IDE version.

ArizmendiTeam
Posts: 10
Joined: Fri 13 Jul 2018 18:36

Re: Function IsNull returns wrong value

Post by ArizmendiTeam » Fri 27 Jul 2018 14:27

Hi, thanks for the reply.

I'm using UniGui with version 5.2.8 of IBDAC with Delphi 10.2 Tokyo.
I did the test using DBGrid and I did not get that error (I did several tests but not this one) so obviously I will have to do with the people of Unigui the problem.

Thanks again

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Function IsNull returns wrong value

Post by ViktorV » Mon 30 Jul 2018 10:49

Thank you for the interest in our products.
We hope that our product will be useful for you in the implementation of your projects.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.

Post Reply