Type mismatch fo fields string - widestring

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
Posts: 2
Joined: Mon 23 Mar 2015 09:50

Type mismatch fo fields string - widestring

Post by dsonnet » Mon 23 Mar 2015 10:00


I downloaded the trial from your site because I would like to add blob support to my application. I encountered some string mismatch issues when just replacing the driver in my application. I tried to start a brand new project, added a few components (SQLConnection, SQLDataset, provider and clientdataset). If I start the project with no design time created fields no problem, if I add all the fields from the IDE, the string fields are created as string, but then when I start the application I get a crash with the string mismatch error.

Any help appreciated.


Devart Team
Posts: 3047
Joined: Wed 30 Jul 2014 07:16

Re: Type mismatch fo fields string - widestring

Post by ViktorV » Tue 24 Mar 2015 09:10

If you have persistent fields created with UseUnicode=False, all varchar fields will be mapped to TStringField. If you change UseUnicode to True and don't remove persistent fields, the following error will occur on dataset opening: "Type mismatch for field 'FIELDNAME', expecting: String actual: WideString".
Please make sure that the UseUnicode parameter value in run time is equal its value in design time.

Post Reply