Text format for SQLite connection

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Nono
Posts: 4
Joined: Tue 05 Oct 2010 06:52

Text format for SQLite connection

Post by Nono » Tue 05 Oct 2010 07:03

Hi.

I use UNIDac (Version 3.00.0.2) to connect a SQLite database with a Delphi 6 application.

I also use the SQLite administrator to check the state of my database.

I have a problem with the data format when I have some accents in the characters (I speak french so we do have a lot of accents :) ).

For example :

Inserted from Delphi via UNIDac : öööööööööööööööööööööööööööööööööö
Read in SQLite administrator : ööööööööööööööööööööööööö

Inserted from SQLite administrator : èèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèè
Read in Delphi via UNIDac : Nothing.

I tried with SQLite VARCHAR, NVARCHAR and TEXT datatype. It makes no difference.

I also tried to set the UseUnicode option of the UNIDac connection to "True" and it makes no difference.

I tried to connect the SQLite DB via an ODBC driver (Using standard components and not UNIDac components), I have the same value as in the SQLite administrator.

How can I have the same data format between the UNIDac connection and the SQLite administrator?

Thank you

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 05 Oct 2010 08:42

Hello,


To insert this string you should set the UseUnicode property to true and use explicit typecast, for example

UniQuery1['FIELD_NAME']:=WideString('ööööööööööööööööööööö');

Nono
Posts: 4
Joined: Tue 05 Oct 2010 06:52

Post by Nono » Tue 05 Oct 2010 08:56

Hi AlexP, thank you for your answer.

I tried your solution and it still doesn't work. I used a button which makes :

Code: Select all

     UniTable1.Edit;
     UniTable1['VARCHAR50']:=WideString('ööööööööööööööööööööö');
     UniTable1.Post;
In SQLadministrator, I have ööööööööööööööööööööö

the field named VARCHAR50 is a NVARCHAR field. In Delphi, it is a TWideStringField.

Did I make a mistake in the code? the UseUnicode option is only in the UniConnection option or I have to change it elsewhere?

Thank you

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 05 Oct 2010 12:02

Hello,

I am using SQLite Expert (www.sqliteexpert.com) to work with SQLite databases, and everything is displayed correctly. I've downloaded SQLite Administrator, and really the strings in it are not displayed correctly. I think it's a SQLite Administrator bug.
Please download SQLite Expert or any other SQLite manager and try again.

Post Reply