Wrong Fieldtype

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
MarioM
Posts: 3
Joined: Tue 10 Dec 2013 11:21

Wrong Fieldtype

Post by MarioM » Tue 10 Dec 2013 11:39

I'm evaluating if buying your Driver dbexpmda.dll, downloaded three days ago. I'm using it with Mysql 4.0.13 and Delphi 7.0 Build 8.1. I get the error message
"Type mismatch for field 'xyz', expecting: FMTBcdField actual: BCD" for
Fields of type DECIMAL(8,2). It returns the wrong Fieldtype. I've seen a similar problem in your forum dated august 2013(but with different version both of Mysql and Delphi) and in the answers you say that it will be patched presumibly in October (2013), have you solved the problem? Do you have a patch I can use?.

AndreyZ

Re: Wrong Fieldtype

Post by AndreyZ » Tue 10 Dec 2013 12:07

I have checked this question using the latest dbExpress driver for MySQL version 6.3.4 , Delphi 7 Build 8.1 , and MySQL 4.0.21. For DECIMAL(8,2) columns, dbExpress driver for MySQL correctly creates TFMTBCDField fields.

MarioM
Posts: 3
Joined: Tue 10 Dec 2013 11:21

Re: Wrong Fieldtype

Post by MarioM » Wed 11 Dec 2013 16:06

I have only changed in a pre-existent procedure the TSQLConnection drivername to DevartMySQL (LibraryName dbexpmda.dll) instead of the default MYSQL (dbexpmysql.dll) and I received the message about the wrong fieldtype when opening the TSQLdataset, connected to the TSQLConnection, with fields formerly defined. If the Fieldtype DevartMysql gives is right, does it mean that pre-existent Delphi default was wrong?

AndreyZ

Re: Wrong Fieldtype

Post by AndreyZ » Thu 12 Dec 2013 07:51

The "Type mismatch for field 'xyz', expecting: FMTBcdField actual: BCD" error means that you have a persistent TFMTBCDField field in your dataset but driver returns TBCDField field. For DECIMAL(8,2) columns, dbExpress driver for MySQL creates TFMTBCDField fields. It means that using the latest dbExpress driver for MySQL you will not encounter this error, as driver returns exactly the field type that is expected by your dataset.

MarioM
Posts: 3
Joined: Tue 10 Dec 2013 11:21

Re: Wrong Fieldtype

Post by MarioM » Fri 13 Dec 2013 21:27

Thank you for the information, I'm going to recharge all fields related to decimal fields in the field definitions of ClientDataSet and SQLDataSet after changing the connection to Devart, and to change all assignment to currency variable specifing :=ClientDataSetFieldName.AsCurrency instead of :=ClientDataSetFieldName.Value.

AndreyZ

Re: Wrong Fieldtype

Post by AndreyZ » Mon 16 Dec 2013 09:50

You are welcome. If any other questions come up, please contact us.

Post Reply