Page 1 of 1

ntext field problem

Posted: Fri 17 Jun 2005 09:17
by janog
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 ?!

Posted: Fri 17 Jun 2005 14:58
by Ikar
TMemoField, using that ClientDataSet represents NTEXT fields, doesn't provide working with Unicode.

You have to convert manually.

Posted: Mon 20 Jun 2005 08:54
by Guest
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

Posted: Tue 21 Jun 2005 11:11
by Ikar
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.