Unidac Forcing to use WideString in D2009 instead of string

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
devweb
Posts: 16
Joined: Sat 02 Feb 2008 08:10

Unidac Forcing to use WideString in D2009 instead of string

Post by devweb » Wed 11 Mar 2009 15:36

Hello,

I have an application that we migrate to D2009, we use mysql and we converted the database to use UTF8 to have full unicode support.

However, for all our quires and virtual tables that they have persistent fields of type string we got this error:

Type mismatch for field 'MyField', expecting: String actual: WideString.

Shouldn't be string stay as string for D2009? migrating string type to wide string will slow down the performance of the application, so it seems it's a bug !!!

You can check that simple by make a connection (don't set the unicode property to true) then drop a query, double click on it , then right click and choose add all fields

Now convert the Unicode property of connection to true, now when u try to open the connection you got that error.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 12 Mar 2009 08:55

TStringField and TWideStringField use memory buffer to store data. The fields do not store data in String or WideString variables. So performance is the same.

TStringField stores data in a buffer in Ansi encoding. TWideStringField stores data in Unicode encoding. You need to use TWideStringField for working with Unicode data.

exbo
Posts: 7
Joined: Thu 22 Oct 2009 20:07

Post by exbo » Tue 03 Nov 2009 15:07

Plash wrote:

..TStringField and TWideStringField use memory buffer to store data.
The fields do not store data in String or WideString variables.
So performance is the same.

TStringField stores data in a buffer in Ansi encoding.
TWideStringField stores data in Unicode encoding.
You need to use TWideStringField for working with Unicode data.a...


Ok, connecting to unicode prepared Firebird or MySQL-DB's causes creation of TWideStringField typed persistent fields. But when i connect to a Sql Server 2005 DB TStringField-Instances are created for char / varchar DB-Fields and multilanguage datatransfer works too. Does Unidac create a specialized descendant of TStringField for string data exchange with SQL Server 2005 tables ?. For me who has to implement support for the DBMS Firebird, MySQL and SQL Server (2005) in my project it seemed to be more effectively to create two different programs (Firebird and MySQL are handled in the same manner) than to compensate the differences in TStringField-Handling in one application.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 04 Nov 2009 10:37

TStringField does not support Unicode. So you cannot work with Unicode data in SQL Server when using this type of field.

Post Reply