Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2020-05

AsString and AsWideString both return 255 Bytes

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi, using SQLite3, the latest version of Lazarus 2.0.8 and I assume FPC.

This
sqlMain.FieldByName('name').AsString;
and this
sqlMain.FieldByName('name').AsWideString;

BOTH return 255 Bytes. I have a TEXT Field in the database 1776 Bytes long. The data looks OK in SQBrowser, but FPC/Lazarus brings in only 255 Bytes. Yes I have the fpcobj and $H+ set.

I posted here but so far not getting anywhere.
https://forum.lazarus.freepascal.org/index.php/topic,49721.0.html

The 1776 Bytes of data is being saved (.ExecSQL) to the file OK, but on read back I only get that 255.

How can I make this work please?

Reply by email

gabor
to Unknown author

W dniu 2020-05-08 o 22:26, Bob via fpc-devel pisze:

Show quoted text 18 lines
Hi, using SQLite3, the latest version of Lazarus 2.0.8 and I assume FPC. This sqlMain.FieldByName('name').AsString; and this sqlMain.FieldByName('name').AsWideString; BOTH return 255 Bytes. I have a TEXT Field in the database 1776 Bytes long. The data looks OK in SQBrowser, but FPC/Lazarus brings in only 255 Bytes. Yes I have the fpcobj and $H+ set. I posted here but so far not getting anywhere. https://forum.lazarus.freepascal.org/index.php/topic,49721.0.html The 1776 Bytes of data is being saved (.ExecSQL) to the file OK, but on read back I only get that 255. How can I make this work please?

Maybe wrong TField.Size value?
Can you check value of sqlMain.FieldByName('name').Size?

Michał.

Reply by email

Michael Van Canneyt
to Unknown author: Hi, using SQLite3, the latest version of Lazarus 2.0.8 and I assume FPC. This…
Bob wrote 13 lines
Hi, using SQLite3, the latest version of Lazarus 2.0.8 and I assume FPC. This sqlMain.FieldByName('name').AsString; and this sqlMain.FieldByName('name').AsWideString; BOTH return 255 Bytes. I have a TEXT Field in the database 1776 Bytes long. The data looks OK in SQBrowser, but FPC/Lazarus brings in only 255 Bytes. Yes I have the fpcobj and $H+ set. I posted here but so far not getting anywhere. https://forum.lazarus.freepascal.org/index.php/topic,49721.0.html The 1776 Bytes of data is being saved (.ExecSQL) to the file OK, but on read back I only get that 255.

Without sample database definition and test program, it's difficult to comment.

The post that is referred to:
https://forum.lazarus.freepascal.org/index.php?topic=40253.0

Sums up the issue rather nicely. If the proposed solution there does not work for you, we'll need a sample program to investigate the issue.

If you send the form lfm file and .pas file from your program + sql to create the table directly to me, I can have a first look at that, save you the trouble of making a demo.

Michael.

Reply by email