troubleshooting Question

Delphi 2009 + dbExpress + MySQL Unicode problem

Avatar of fulopattila
fulopattilaFlag for Romania asked on
DelphiMySQL ServerEditors IDEs
5 Comments1 Solution5865 ViewsLast Modified:

I have recently upgraded to Delphi 2009 in order to correctly use Unicode databases.
I'm connecting to a UTF-8 MySQL 5 db via dbExpress, using Devart's dbExpress driver (v4.40)
Using standard TSQLConnection, data is accessed thru TSQLQuery->TDataSetProvider->TClientDataSet->TDataSource
The problem is, that when adding fields to FieldList (via Add All Fields), string fields get mapped to TStringField which is AnsiString not WideString. Therefore when executing application I get the following error message:
Project bbadmin.exe raised exception class EDatabaseError with message 'sqqTeams: Type mismatch for field 'NAME', expecting: String actual: WideString'.

I think I could manually chage their types to TWideStringField, however I doubt it would be the way doing it.

How can I manage to get these Fields automatically mapped to WideString fields?

Thank you
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros