Mysql UTF8 : EInvalid Cast with message 'Invalid Class typecast'

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Hans
Posts: 52
Joined: Wed 24 Aug 2005 20:05

Mysql UTF8 : EInvalid Cast with message 'Invalid Class typecast'

Post by Hans » Mon 26 Mar 2007 20:13

Hi,

I changed character set from latin1 to utf8 and i get 'Invalid Class typecast'. Delphi debugger does not help me very much.

Does this have to do enything with the corelab components?

Should i change anything else in the database to get utf8 working?

Thanks!

best regards,
Hans

Hans
Posts: 52
Joined: Wed 24 Aug 2005 20:05

Post by Hans » Tue 27 Mar 2007 06:55

Well it might have to to something with mysql upgrade 5.027 to 5.0.37.

Hans
Posts: 52
Joined: Wed 24 Aug 2005 20:05

Post by Hans » Tue 27 Mar 2007 09:19

Hi,

It looks like my problem was caused by a bug in de TMyQuery component. A copy of the component seems to work fine. So i deleted the original.

best regards,
Hans

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 27 Mar 2007 11:20

Most possible reason of this problem is that you have created fields for the query in design time. All the string fields were interpreted as TStringField with the latin1 character set. But after you changed character set to utf8, all the string fields are interpreted as TWideStringField.
You could fix this problem just by recreating fields in design time.

Post Reply