I have a table that contains ntext field type. If the field contain some unicode character or symbols such as € or £, it will hit "Stream read error" when that field is being display in grid or dbEditBox.
There is no error when I use TADODataSet and do the same thing.
I'm currently using Delphi 6 and SDAC 3.80.0.37.
Thanks
Error with ntext field type
Both ADO and SDAC convert NTEXT field values to string when you try to access it using the TMemoFiels.AsString method.
There is no TWideMemoField type in Delphi 6.
So the data is always truncated. To access data as widestring, use the following code:
Standard DB-aware controls do support Unicode. You should use any third party controls, for example TNT controls.
There is no TWideMemoField type in Delphi 6.
So the data is always truncated. To access data as widestring, use the following code:
Code: Select all
uses
MemData;
...
var
Blob: TBlob;
Value: widestring;
begin
Blob := MSQuery1.GetBlob('FieldName');
if Blob.IsUnicode then
Value := Blob.AsWideString;
end;
Perhaps I did not explain it clearly.
The issue here is that there is not error when I use TADODataSet for the same field, but when using SDAC the error appears.
If the problem is with Delphi 6 TWideMemoField, then TADODataSet should also have that error.
Thanks
The issue here is that there is not error when I use TADODataSet for the same field, but when using SDAC the error appears.
If the problem is with Delphi 6 TWideMemoField, then TADODataSet should also have that error.
Thanks
EvgeniyM wrote:Both ADO and SDAC convert NTEXT field values to string when you try to access it using the TMemoFiels.AsString method.
There is no TWideMemoField type in Delphi 6.
So the data is always truncated. To access data as widestring, use the following code:Standard DB-aware controls do support Unicode. You should use any third party controls, for example TNT controls.Code: Select all
uses MemData; ... var Blob: TBlob; Value: widestring; begin Blob := MSQuery1.GetBlob('FieldName'); if Blob.IsUnicode then Value := Blob.AsWideString; end;
We couldn't reproduce the problem with "Stream read error" exception.
Please send us (evgeniym*crlab*com) a complete small test project to reproduce the problem;
include definition of your own database objects and script for populating tables with data or send us a database backup.
Also specify exact version of Microsoft SQL Server and OLE DB provider you use. You can see it the Info sheet of TMSConnection Editor.
Please send us (evgeniym*crlab*com) a complete small test project to reproduce the problem;
include definition of your own database objects and script for populating tables with data or send us a database backup.
Also specify exact version of Microsoft SQL Server and OLE DB provider you use. You can see it the Info sheet of TMSConnection Editor.
Thank you for information.
We have reproduced the problem.
There is a bug in Delphi 6 Vcl with converting WideString to AnsiString in the function CharFromWChar (System.pas).
We have implemented the workaround of this problem.
This workaround will be available in the next build of SDAC 3.
Please watch for announcements at the forum.
We have reproduced the problem.
There is a bug in Delphi 6 Vcl with converting WideString to AnsiString in the function CharFromWChar (System.pas).
We have implemented the workaround of this problem.
This workaround will be available in the next build of SDAC 3.
Please watch for announcements at the forum.