Hello,
I have a MSTable that is referencing a table with a decimal(30,15) column. The field is being seen as a TFMTBCDField (which is what I want). When I try to edit the value in the decimal field I get a EConvertError when Post is called. Here is the code that is changing the value:
var
bcd: TBcd;
s: string;
begin
with MSTable1 do begin
First;
s := FieldByName('exchange_rate').AsString;
s := '1' + s;
bcd := StrToBcd(s);
Edit;
if FieldByName('exchange_rate') is TFMTBCDField then
TFMTBCDField(FieldByName('exchange_rate')).AsString := s
else
FieldByName('exchange_rate').AsString := s;
Post; // This is where the EConvertError is generated
end;
Please note that this is only a test and the above logic is just to validate the functionality of the components. I have also tried:
...
TFMTBCDField(FieldByName('exchange_rate')).Value := bcd
...
The value that I was testing is 0.72222 and the value I am updating it to is 10.72222 (Well within the limits of a BCD and decimal(30,15).
Any suggestions will be greatly appreciated.
Tom
EConvertError on Post
We couldn't reproduce the problem.
Please send us (evgeniym*crlab*com) a complete small test project to reproduce the problem;
include definition of your own database objects; don't use third party components.
Also supply us the following information:
- Exact version of Delphi or C++ Builder.
- Exact version of SDAC. You can see it in the About sheet of TMSConnection Editor.
- Exact version of Microsoft SQL Server and OLE DB provider you use. You can see it the Info sheet of TMSConnection Editor.
Please send us (evgeniym*crlab*com) a complete small test project to reproduce the problem;
include definition of your own database objects; don't use third party components.
Also supply us the following information:
- Exact version of Delphi or C++ Builder.
- Exact version of SDAC. You can see it in the About sheet of TMSConnection Editor.
- Exact version of Microsoft SQL Server and OLE DB provider you use. You can see it the Info sheet of TMSConnection Editor.