MsSql 2008 nvarchar(max) problem

Forum related to ADO

Moderators: gto, cipto_kh, EgonHugeist

Locked
spin
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 28.02.2023, 10:20

MsSql 2008 nvarchar(max) problem

Post by spin »

MsSql 2008 nvarchar(max) problem
I am asking for help with the following problem:
Zeos version: 7.2.14-release
Lazarus version: 2.2.4 FPC: 3.2.2
Operating system: win10

ZConnection properties:
AutoEncodeStrings=ON
codepage=CP_UTF8
controls_cp=CP_UTF16
ZConnection protocol: ado

After connecting, I can see nvarchar(800), but I can't see the nvarchar(max) data.:
names(nvarchar(max),nul)

ZQuery1.FieldByName('names').AsString;
ZQuery1.FieldByName('names').AsWideString;
ZQuery1.FieldByName('names').AsUTF8String;
ZQuery1.FieldByName('names').AsUnicodeString

I try any of them, my variable is empty!

It is interesting that:
i:=length(ZQuery1.FieldByName('names').AsUnicodeString);

'i' always returns a good value.

I can modify it: 'UPDATE tbl_data set names = '''+ 'New name: ÁáÖöÜüÓóÉéŐőÚú'+',' +''' where id = '''+tbl_id+'''';

This works fine, I can see the modified data correctly in SQL Server Management Studio.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: MsSql 2008 nvarchar(max) problem

Post by marsupilami »

Locked in favor of viewtopic.php?f=16&t=179692
Locked