Wrong field types and mismatch errors

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Max Terentiev
Posts: 19
Joined: Sun 05 Jun 2016 17:11

Wrong field types and mismatch errors

Post by Max Terentiev » Sun 05 Jun 2016 17:29

Hi,

I create table with folowing SQL code:

CREATE TABLE IF NOT EXISTS domains(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
serverid INTEGER,
name VARCHAR,
startdate DATE,
enddate DATE,
ip INTEGER,
dkimpublic TEXT,
dkimprivate TEXT
);

CREATE INDEX IF NOT EXISTS idx_domains_server ON domains ( serverid );

Then right click on TLiteTable, Fields Editor -> Add all fields.

I don't know why but string fields created with wrong field type: name, dkimpublic, dkimprivate created as TWideMemoField !

Now then I try to open table I got an exception: Type mismatch for field 'dkimpublic', expecting: 'WideMemo' actual 'WideString'. But it's not right because fields was created automatically ! LiteDAC should suggest correct field types !

LiteDAC 2.7.23, RAD Studio XE7. LiteConnection.Options have Direct=true and UseUnicode=true.

It's bug in LiteDAC or my mistake ? Note: ZEOS DBO works well with this database.

MaximG
Devart Team
Posts: 1025
Joined: Mon 06 Jul 2015 11:34

Re: Wrong field types and mismatch errors

Post by MaximG » Tue 07 Jun 2016 07:59

When UseUnicode=true, the fields Name, dkimpublic, dkimprivate must be mapped as TWideMemoField, that is correct behavior. The «Type mismatch» error may occur in case of applying DataTypeMapping in the TLiteTable component. In such case, please make sure the data mapping rules are correctly set in TLiteTable.

Post Reply