Page 1 of 1

EConvertError on Post

Posted: Sat 05 May 2007 06:14
by tolson68
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

Posted: Mon 07 May 2007 06:16
by tolson68
I made a change the the SDAC demo application so the NumericType is set to FMTBCD and I can reproduce the error. I am using D7 Pro.

Please Help! This is a show stopper for us.

Posted: Mon 07 May 2007 08:52
by Jackson
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.

Posted: Mon 07 May 2007 17:38
by tolson68
Jackson,

I sent you the information you requested. Please let me know if you have any other questions.

Tom