Page 1 of 1

Postgresql + Delphi 7 + ZeosLib + Long Strings

Posted: 27.01.2014, 19:36
by mnemonic_br
Hello! I've reading since last week this forum before I could post, but I cannot find any solution, sorry me if I failed in searching better.

Well, I am using a Delphi 7 application that reads a long string field. I read that newest version had no more issues, so I changed my old 6.6 to the new 7.1.3-stable, but after run I had the same problem. After that 4069 bytes get truncated or with pointer errors (showing non corrects characteres).

I tried cast the text field with varchar(8128, ie.), tried use .AsVariant, .Text... or I get error or it doenst works. I also read something about change the limit but I cannot found how to.

Please someone else is facing that, and if so, how to fix it?

Thank you very much!

Re: Postgresql + Delphi 7 + ZeosLib + Long Strings

Posted: 28.01.2014, 10:48
by miab3
@mnemonic_br,
so I changed my old 6.6 to the new 7.1.3-stable
Do not use version 7.1.3-stable (mistakenly published), only use version 7.1.3a-stable.

MichaƂ

Re: Postgresql + Delphi 7 + ZeosLib + Long Strings

Posted: 28.01.2014, 23:13
by EgonHugeist
@mnemonic_br,

Michal is right here with the Zeos version.

To your issue: You won't be lucky with strings > 8KB -1Byte Since TString/WideString field of unit DB supports 8KB-#0 byte only. So you're producing unwanted stack-killers.
Delphi writes TField.Size equals to count of Chars which is horrable wrong for MBCS encoded strings...

May i ask for you field declaration?

Possible suggestion: Use 7.2 and add a global define {WITH_ZSTRINGFIELDS} to your project options. I've alredy started to kill such showstoppers of Delphi and FPC but i'm not ready...It's untested and TField.Validate doesn't work. Otherwise these fields will increase your performance too.. Just an suggestion.