Board index » delphi » Problem with TBCDField using MSSQL 6.5

Problem with TBCDField using MSSQL 6.5

Hi,

Ive created a table on MSSQL 6.5 where a column is defined as
decimal(12,6).
Ive wrote an application to mantain this table using a request live TQuery.
When I clicked on "Add fields" options in the fields editor Delphi 3 was
create a TBCDField for the decimal(12,6) column.

My problem is:

When I type any value that has more than 4 decimal digits (e.g. 2.654321),
after post the value recorded in the table will have only 4 decimal digits.
In exemplified case the recorded value will be 2.654300.

How can I do to solve this problem ?

Thanks in advance.

Jerry - Brazil

 

Re:Problem with TBCDField using MSSQL 6.5


Core of your problem is that TBCDField uses currency type for storing data.
You have to set EnableBCD=False in your BDE Alias configuration.
Then TFloatField will be created instead of TBCDField which is using double
type.
Quote
Jerry Adriane Gon?alves wrote:
> Hi,

> Ive created a table on MSSQL 6.5 where a column is defined as
> decimal(12,6).
> Ive wrote an application to mantain this table using a request live TQuery.
> When I clicked on "Add fields" options in the fields editor Delphi 3 was
> create a TBCDField for the decimal(12,6) column.

> My problem is:

> When I type any value that has more than 4 decimal digits (e.g. 2.654321),
> after post the value recorded in the table will have only 4 decimal digits.
> In exemplified case the recorded value will be 2.654300.

> How can I do to solve this problem ?

> Thanks in advance.

> Jerry - Brazil
Jerry Adriane Gon?alves wrote:
> Hi,

> Ive created a table on MSSQL 6.5 where a column is defined as
> decimal(12,6).
> Ive wrote an application to mantain this table using a request live TQuery.
> When I clicked on "Add fields" options in the fields editor Delphi 3 was
> create a TBCDField for the decimal(12,6) column.

> My problem is:

> When I type any value that has more than 4 decimal digits (e.g. 2.654321),
> after post the value recorded in the table will have only 4 decimal digits.
> In exemplified case the recorded value will be 2.654300.

> How can I do to solve this problem ?

> Thanks in advance.

> Jerry - Brazil

Other Threads