TRzDBNumericEdit accepts no fields type DECIMAL or NUMERIC ?

Components on the Raize Edits palette: edits, button edits, date-time edits, spin edits, color edits, memos, track bars, etc.

TRzDBNumericEdit accepts no fields type DECIMAL or NUMERIC ?

Postby Hans Brenkman » Wed May 18, 2011 5:21 am

Hi,

I used before TRzDBNumericEdit with a field type NUMERIC(18,2) (FireBird database). In the new version 5.5.1 is TRzCalculator implemented in TRzDBNumericEdit and i have read in RC5WhatsNew.pdf "The calculator supports both Integer and floating point operations." Does that mean that TRzDBNumericEdit no longer supports fields of type NUMERIC and DECIMAL in a FireBird database ?

With a NUMERIC(5,2) field (property DisplayFormat € #0.00) I get a EConvertError : "=' is not a floating point value.' (RzDBEdit.pas procedure TRzDBNumericEdit.DataChanged line 2464). A FLOAT is -as expected- no problem but I don't want to use a FLOAT when the value is a money value with exact 2 decimals.

Greetings,
Hans
Last edited by Hans Brenkman on Mon May 23, 2011 3:49 am, edited 1 time in total.
Hans Brenkman
 
Posts: 6
Joined:
Wed May 18, 2011 4:27 am

Re: TRzDBNumericEdit accepts no fields type DECIMAL or NUMER

Postby Hans Brenkman » Thu May 19, 2011 2:32 am

It seems that the stored type in the database of a field NUMERIC(18,2) is BIGINT, of a field NUMERIC(5,2) is SMALLINT (see The FireBird Book from Helen Borrie page 127) which both give the EConvertError in RzDBEdit.pas procedure TRzDBNumericEdit.DataChanged line 2464
Code: Select all
Value := DataLink.Field.AsFloat;

But even if I declare a field NUMERIC(10,2) which is stored as an INTEGER gives an EConvertError ("?' is not a valid floating point vallue') except when the value in the field is null.
Hans Brenkman
 
Posts: 6
Joined:
Wed May 18, 2011 4:27 am

Re: TRzDBNumericEdit accepts no fields type DECIMAL or NUMER

Postby Raize Support » Fri May 20, 2011 10:59 pm

Hi Hans,

The fields that are supported in TRzDBNumericEdit have not changed. The addition of the calculator to the TRzNumericEdit and TRzDBNumericEdit simply affect the ability to display a drop down calculator to be used to edit the value.

From what you describe, it sounds like you have compiled the source code of the components into your application and that you are running the application through the debugger. And when a formatting exception is raised, which can indeed happen when the component attempts to parse the data, the IDE is trapping the exception. The control's handle the exceptions internally and you never see the exceptions, but when you run the program in the IDE, the IDE will trap them.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 410
Joined:
Fri Mar 25, 2011 9:04 pm

Re: TRzDBNumericEdit accepts no fields type DECIMAL or NUMER

Postby Hans Brenkman » Mon May 23, 2011 8:34 am

Hi Ray

Thanks for your answer. I tried if the problem doesn't exists in a compiled executable (outside the IDE). Only when the field-value is NULL (initial), it displays "€ 0,00" without any problem. In other situations I still get the EConvertError when I open the form (propertys DataSource and DataField are defined in the Object Inspector) and the value in the field is <> NULL or try to save a value.

So I made a new application with only the same connection to the FireBird database and components to edit the same field and one form with one TRzDBNumericEdit. That works fine, so it seems that both the component and the defined field in the database were not causing the error. I tried several things and finally I came tot the conclusion that when I include "dbExpInt" (dcu) in the project file I got the same error in the simple test-app. The Borland dbExpress INTERBASE driver (version 7.1.1523.17956) was included because of the purpose of a stand-alone app so I don't need to deliver other dll's or so. Now I have to find out if I can go on with this solution or that there is a newer dbExpInt.dll.

I noticed that without including dbExpInt that a ClientDataSet.Post followed by ApplyUpdates saves the value (I close and open the application and I get the new value) but I can't see the new value in IBExpert with refresh until I do an explicit commit in IBExpert. So that is for sure one thing to give attention to.

Thanks
Hans
Hans Brenkman
 
Posts: 6
Joined:
Wed May 18, 2011 4:27 am


Return to Edits

Who is online

Users browsing this forum: No registered users and 1 guest

cron