January 12, 2006

Delphi 2006: Unicode and DB

Borland says Delphi 2006 has Unicode support for dbExpress, while, in fact, it is all over the TDataSet class.

Among Delphi 2006 features list there is a item indicating "Unicode support in dbExpress drivers". This is true, as the new dbExpress drivers interface uses wide strings for most purposes, including passing metadata and queries. But it is certainly an understatement, as wide strings (unicode) support is now pervasive in Delphi's database architecture. If you think pervasive is a strong word, look at this list of features affected by the change:

  • TField properties like FieldName, DisplayName, DisplayLabel FullName, plus lookup and key fields are now wide strings
  • GetFieldNames of TDataSet returns a wide string list
  • DataField property of data-aware controls (yes, all of them!) is wide
  • There is a new TWideDataSet class, from which all datasets descend (except the BDE ones)
  • SQL commands (SQL in ADOQuery and the like) use wide strings
  • There is a new WideMemoField
  • New TFieldTypes includes ftFixedWideChar and ftWideMemo
  • DataSnap interfaces have been udpated accordingly

Yes, it is a pervasive change and notice that not all existing code will compile immediately (for example, string lists and wide string lists are not assignment compatible)... but I think the change is very positive.



Delphi 2006: Unicode and DB 

What affect will that have on performance? Or are
WideStrings in D2006 reference counted now?
Comment by hulver [http://www.hulver.com/scoop/] on January 12, 19:16

Delphi 2006: Unicode and DB 

Hi Marco,

Does it mean a full unicode/widestring support for
Win32 VCL is on the road or there is still speculation
only about? 
(I remember it was stated there will be a full Win64
VCL unicode support but there was never a clear
statement about Win32 one...)

Comment by Zlatibor Boro Urosevic on January 16, 11:56

Delphi 2006: Unicode and DB 

The VCL is indeed moving towards wide strings and
Unicode... but (for now) only for the non visual
portion, that has no direct connection to the Windows
API. Actually in 2006 there are also some low level
RTL fixes to better support old-non-unicode-enabled
versions of Windows 9x, but the lack of full wide
string support in the OS is certainly sill a limiting
It is true that Borland has tied the development of a
Unicode VCL to the 64 bit platform, but I guess this
is subject to change as R&D progresses towards the
actual development of future versions of Delphi.
So I guess we'll have to wait and see...
Comment by Marco Cantù [http://www.marcocantu.com] on January 16, 23:06

Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.