Page 1 of 1

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

Posted: 10.10.2010, 20:39
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

Posted: 12.10.2010, 13:01
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

Posted: 12.10.2010, 14:05
by Cappuccino
Hi Jaco,

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

Regards,
Tom

Posted: 12.10.2010, 15:05
by CJBriers
I found using the VARCHAR type (without specifiying the length) also works