ntext field problem

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
janog

ntext field problem

Post by janog » Fri 17 Jun 2005 09:17

I'm using TMSQuery to read NTEXT field, when using
MSQuery.GetBlob('blobfld').AsWideString ... everything is allright..

but.. I would like to use combination
MSQuey -> TDataSetProvider -> TClientDataSet ..
but
ClientDataSet.FieldByname('blobfld').AsValue (or AsString ...) doesn't work..

how to setup components ... to correct trasfer of unicode blob data ?!

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 17 Jun 2005 14:58

TMemoField, using that ClientDataSet represents NTEXT fields, doesn't provide working with Unicode.

You have to convert manually.

Guest

Post by Guest » Mon 20 Jun 2005 08:54

Ikar wrote:TMemoField, using that ClientDataSet represents NTEXT fields, doesn't provide working with Unicode.

You have to convert manually.
ok... but how exactly ?
TMSQuery.GetBlob().AsWideString -> UTF8String -> ??? -> Provider -> TClientDataSet.FieldByName().AsString -> UTF8 to UNICODE !

which event .. is usefull to encode UNICODE to UTF8 .. to post string from MSQuery through Provider into ClientDataSet ?
jg

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 21 Jun 2005 11:11

Due to MIDAS specificity on transferring data from TMemoField MSQuery to TMemoField ClientDataSet specific Unicode information will be lost.

Suppose, the easiest way to solve the problem is to declare field type at the server not as NTEXT but as IMAGE. Certainly you have to make conversions:

Code: Select all

var
 ws: WideString;

 ws := UTF8Decode(ClientDataSet.FieldByName().AsString) etc
It is hard to say more exactly, it depends on controls that you use.

Post Reply