Problem with Memo - TEXT field

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Chewy
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 09.08.2007, 14:24

Problem with Memo - TEXT field

Post 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?
rautgigi
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 08.10.2006, 19:54

Post 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,
CJBriers
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 12.10.2010, 12:08

Post 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
Post Reply