Page 1 of 1

Problem with Memo - TEXT field

Posted: 09.08.2007, 14:39
by Chewy
Hello!
I use SQLITE DB table with TEXT type fields and in Delphi7 I use Zeos TZQuery.
I loaded the fields in the query, and the text fields are automatically typed as ftMemo. BUT I want to handle as String like ftWideString because the TcxDBMemo (DevExpress) component is not abble to control the 'enter as tab' function. (ad also the contained string's length < 255) I want to use TcxDBText instead of TcxDBMemo, but i get an error message like the data type is wrong. (Memo - String)
If I change the field type to ftWideString in the TZQuery, I get an error message when the query opened. "Type mismatch: expecting: WideString actual: Memo"
Is there any solution for my problem?

Posted: 10.08.2007, 11:41
by rautgigi
Hi,

You can try to creat the table using something like : create table test (column varchar) ...
SqLite dosen't care about the type name of the field so you can write anything there.
After that the Zeos will handle the type that you enter into the create table statement using pragma table_info(tblName) and the procedure ConvertSQLiteTypeToSQLType from the dbc\ZDbcSqLiteUtils.pas
This will create a field ftString, if you really need ftWideString i think you can modify the ConvertSQLiteTypeToSQLType procedure to handle a specific SqLite column type

Best regards,

Posted: 12.10.2010, 15:04
by CJBriers
Hi,

I have the same problem. The SQLite TEXT type gets translated to a TMemo field instead of to a TWideStringField for my TZQuery component. This causes issues for some components (such as DBGrid) that do not display memo fields correctly (only shows "(MEMO)"). Does someone know if this TEXT-TMemo translation is intentional?

I know of two ways around it. See this post:
http://zeos.firmos.at/viewtopic.php?t=2990

Regards,
Jaco