EConvertError on Post

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 5
Joined: Fri 04 May 2007 20:08

EConvertError on Post

Post by tolson68 » Sat 05 May 2007 06:14


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:

bcd: TBcd;
s: string;
with MSTable1 do begin
s := FieldByName('exchange_rate').AsString;
s := '1' + s;
bcd := StrToBcd(s);
if FieldByName('exchange_rate') is TFMTBCDField then
TFMTBCDField(FieldByName('exchange_rate')).AsString := s
FieldByName('exchange_rate').AsString := s;
Post; // This is where the EConvertError is generated

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.


Posts: 5
Joined: Fri 04 May 2007 20:08

Post by tolson68 » Mon 07 May 2007 06:16

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.

Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Mon 07 May 2007 08:52

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.

Posts: 5
Joined: Fri 04 May 2007 20:08

Post by tolson68 » Mon 07 May 2007 17:38


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


Post Reply