Version incompatible dbexpmda.dll (BCD-FMTBcdField)

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
calliandutra
Posts: 4
Joined: Fri 23 Apr 2010 18:08

Version incompatible dbexpmda.dll (BCD-FMTBcdField)

Post by calliandutra » Fri 23 Apr 2010 18:29

Hello

I have an application developed in Delphi 7 using an MySQL database and 4.0 driver dbexpmda.dll (Version 2.50.0.0).

Use as a connection object TSQLConnection.

I'm doing the migration to MySQL 5.1 using dbexpmda.dll driver (version 4.50.0.22).

In the driver version 2.50.0.0 for the return type was decimal BCD, and after updating to version 4.50.0.22 driver is being returned to the type FMTBcdField

Error: TClientDataSet: Type mismatch for field 'FieldName', expecting: BCD current: FMTBcdField

How should I set so that the driver performs the conversion automatically?

It is totally impractical to use all ClientDataSet the application performing the treatment.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 26 Apr 2010 09:56

Please specify the MySQL type mapped to TBCDField.

calliandutra
Posts: 4
Joined: Fri 23 Apr 2010 18:08

Type on MySQL

Post by calliandutra » Tue 27 Apr 2010 19:06

Dimon wrote:Please specify the MySQL type mapped to TBCDField.
Field mapped with TBCDField is decimal type on MySQL 4.0

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 28 Apr 2010 07:46

I can not reproduce the problem.
Decimal MySQL type is mapped to TBCDField.
Please send me a script to create table to dmitryg*devart*com. Also specify the exact version of MySQL server.

calliandutra
Posts: 4
Joined: Fri 23 Apr 2010 18:08

Structure of table and MySQL version

Post by calliandutra » Wed 28 Apr 2010 11:37

Dimon wrote:I can not reproduce the problem.
Decimal MySQL type is mapped to TBCDField.
Please send me a script to create table to dmitryg*devart*com. Also specify the exact version of MySQL server.
Ok, but i have one doubt, maybe I'm doing wrong.

Is necessary add the fields again in the ClientDataSet?

I'm not doing this, I'm only replacing the dbexpmda.dll arquive

-- Answer of last question :

New Version: MySQL 5.1.45-community
Old Version: MySQL 4.0.24-standard-log
Old Version: MySQL 4.1.22-community-nt

Independent of version MySQL used, the error is presented by the driver dbexpmda.dll.

Script of Create Table:

create table PRODUTO
(
PRD_CODIGO int not null,
PRD_DESCRICAO CHAR(40) not null,
PRD_ESPECIEVOLUME CHAR(20) not null,
PRD_SEGUROACIDENTE decimal(6,3),
PRD_SEGURODESCONTO decimal(6,3),
PRD_SEGUROROUBO decimal(6,3),
PRD_SEGUROFIXO decimal(14,2),
PRD_ICMSPAUTA char(1),
PRD_PARACOBRANCAACESSORIA char(1),
PRD_SEGUROSINISTRO decimal(6,3),
PRD_VALORMAXIMOBASESEGURO decimal(14,2),
PRD_TIPOITEM char(4)
);

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 29 Apr 2010 09:24

Thank you for the information.
This behaviour change is caused by problems, that occurs with MySQL Server version 4. The point is that MySQL versions 4 and 5 process DECIMAL fields differently, and changes were done for compatibility.
To solve the problem you should recreate fields in ClientDataSet.

calliandutra
Posts: 4
Joined: Fri 23 Apr 2010 18:08

Post by calliandutra » Fri 30 Apr 2010 12:36

Dimon wrote:Thank you for the information.
This behaviour change is caused by problems, that occurs with MySQL Server version 4. The point is that MySQL versions 4 and 5 process DECIMAL fields differently, and changes were done for compatibility.
To solve the problem you should recreate fields in ClientDataSet.
Thank you.

I'll do some testing, probably will perform a conversion function at runtime for the Fields.

If I get hit, make available to my solution.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 30 Apr 2010 12:48

Feel free to contact us if you have any further questions about DbxMda.

Post Reply