Page 1 of 1

Version incompatible dbexpmda.dll (BCD-FMTBcdField)

Posted: Fri 23 Apr 2010 18:29
by calliandutra
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.

Posted: Mon 26 Apr 2010 09:56
by Dimon
Please specify the MySQL type mapped to TBCDField.

Type on MySQL

Posted: Tue 27 Apr 2010 19:06
by calliandutra
Dimon wrote:Please specify the MySQL type mapped to TBCDField.
Field mapped with TBCDField is decimal type on MySQL 4.0

Posted: Wed 28 Apr 2010 07:46
by Dimon
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.

Structure of table and MySQL version

Posted: Wed 28 Apr 2010 11:37
by calliandutra
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)
);

Posted: Thu 29 Apr 2010 09:24
by Dimon
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.

Posted: Fri 30 Apr 2010 12:36
by calliandutra
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.

Posted: Fri 30 Apr 2010 12:48
by Dimon
Feel free to contact us if you have any further questions about DbxMda.