Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi ADO rounds decimal values from SQL Server

I have a Table (MS SQL Server) with fields of data type decimal(18,8). In my application I enter value 0.000089 and save it. I check with SQL Server Management Studio the table and the value is OK (0.00008000). But when I use TADOQuery to read the value, it's return 0.0001 (always rounded to 4 decimals position - 0.123456789 -> 0.1235). I try TADOTable with TDataSource and TDBTable, also ADOExplorer tool and result was the same. Where is the problem?

like image 891
Mad Dog Avatar asked Jan 18 '26 05:01

Mad Dog


1 Answers

Disable the EnableBCD property in your TADOQuery component

when EnableBCD is true, it can support to 4 decimal places. when EnableBCD is false , the field is mapped to TFloatField.

enter image description here

like image 50
Malainine Avatar answered Jan 19 '26 20:01

Malainine