SqLite, Zeos und keine Textanzeige, im DbGrid steht (MEMO)

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Cappuccino
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 10.10.2010, 20:31

SqLite, Zeos und keine Textanzeige, im DbGrid steht (MEMO)

Post by Cappuccino »

Hello,

I am using SqLite3, Zeos 6.6 and Delphi 6.
Whats working: Access to DB is OK, integers are shown well in DbGrid.

The Problem is, if DataType is TEXT, the Delphi DbGrid shows only (MEMO), but not the correct text.
I am using ZConnection - ZTable, DataSource and DbGrid as a viewer.

Can anyone help me?

Thanks in advance,
Tom


Hallo zusammen,

ich benutze / will benutzen SqLite3, die Zeos-Komponenten und Delphi 6.
Der Zugriff auf die DB und die Anzeige der Daten klappt auch, bis auf die Anzeige von Texten,
in den Feldern stehen Namen und Texte, diese werden aber nur als (MEMO) angezeigt und sind auch nicht editierbar.

Ich habe mal mit anderen Viewern (DqLiteSpy) die Db geöffnet, die Texte werden korrekt angezeigt.

Auf die DB geht es über die Zeos Komponenten ZConnection - ZTable, dann DataSource und Anzeige in einem DbGrid.

Angelegt ist das Feld als: Name TEXT,
auf andere Felder z.B. BaseNbr INTEGER, ist der Zugriff problemlos

Hat mir jemand einen Tip?
Vielen Dank.

Gruß
Tom
CJBriers
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 12.10.2010, 12:08

Post by CJBriers »

Hi Tom,

I have a similar issue. The solutions I've found so far:

If you are allowed, you can change the TEXT field type in the SQLite DB to VARCHAR. Then the values would display in the grid.

If you can not, for some reason, change the type in the DB, use the OnGetText event for the TMemoField's in your ZTable like:

Code: Select all

procedure TDataModuleZZZ.Table1SomeMemoFieldGetText(Sender: TField;
  var Text: string; DisplayText: Boolean);
begin
  Text := Table1SomeMemoField.AsString;
end;
Regards,
Jaco
Last edited by CJBriers on 12.10.2010, 15:07, edited 1 time in total.
Cappuccino
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 10.10.2010, 20:31

Post by Cappuccino »

Hi Jaco,

Thanks for this tip, it helps a lot
(and makes additional work to work around this behaviour)

Regards,
Tom
CJBriers
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 12.10.2010, 12:08

Post by CJBriers »

I found using the VARCHAR type (without specifiying the length) also works
Post Reply