Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Lars Frederiksen
Hi Gunter and Clemens!

Thank you for your help. I appears that the Connection Editor in FDConnection 
has a StringFormat property and after setting this to Unicode the problem was 
solved.

Regards
Lars

-Oprindelig meddelelse-
Fra: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] På 
vegne af Hick Gunter
Sendt: 7. august 2017 10:47
Til: 'SQLite mailing list'
Emne: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

It would be so much easier if you could provide hex dumps of the strings 
involved. Maybe just a few characters and a verbal description of what you 
think you are storing (greek lowercase alpha, ...).

From appearances it seems that your text objects are locale aware, which would 
suggest a code-page based approach instead of UTF8. Hint: If what you put in is 
all special characters and half as long as what is returned, then you are 
converting ISO to UTF8 somewhere along the way.

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Lars Frederiksen
Gesendet: Montag, 07. August 2017 10:39
An: 'SQLite mailing list' <sqlite-users@mailinglists.sqlite.org>
Betreff: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

Hi,

My code is simple. FDConnection, FDQuery, DataSource + DBGrid, 3 Edits and a 
button. Then this OnClick event:

Procedure TForm1.Button1Click(Sender: TObject); begin
  FDTable1.Open;
  FDTable1.Append;
  FDTable1.FieldByName('gms_id').AsInteger:= StrToInt(edNummer.Text);
  FDTable1.FieldByName('gms_graesk').AsString:= edGræsk.Text; // this is greek 
letters but in DBGrid it is something like '?e? e??ae ?a???'
  FDTable1.FieldByName('gms_dansk').AsString:= edDansk.Text;
  FDTable1.Post;
end;

Regards
Lars

-Oprindelig meddelelse-
Fra: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] På 
vegne af Clemens Ladisch
Sendt: 7. august 2017 10:28
Til: sqlite-users@mailinglists.sqlite.org
Emne: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

Lars Frederiksen wrote:
> I have followed 2 tutorials about SQLite, and none of these mentioned the 
> VARCHAR() possibility

Because SQLite pretty much ignores column types.
Interpreting "VARCHAR" this way is how FireDAC does things; you have to look 
into the FireDAC documentation.

> But I also realized that it is not possible just to put some greek (unicode) 
> characters into a field. It ends up with a mix of latin chars and 
> questionmarks.
> Is there a (simple) solution on this problem?

Yes: fix the bugs in your code (which you have not shown).


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Hick Gunter
It would be so much easier if you could provide hex dumps of the strings 
involved. Maybe just a few characters and a verbal description of what you 
think you are storing (greek lowercase alpha, ...).

From appearances it seems that your text objects are locale aware, which would 
suggest a code-page based approach instead of UTF8. Hint: If what you put in is 
all special characters and half as long as what is returned, then you are 
converting ISO to UTF8 somewhere along the way.

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Lars Frederiksen
Gesendet: Montag, 07. August 2017 10:39
An: 'SQLite mailing list' <sqlite-users@mailinglists.sqlite.org>
Betreff: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

Hi,

My code is simple. FDConnection, FDQuery, DataSource + DBGrid, 3 Edits and a 
button. Then this OnClick event:

Procedure TForm1.Button1Click(Sender: TObject); begin
  FDTable1.Open;
  FDTable1.Append;
  FDTable1.FieldByName('gms_id').AsInteger:= StrToInt(edNummer.Text);
  FDTable1.FieldByName('gms_graesk').AsString:= edGræsk.Text; // this is greek 
letters but in DBGrid it is something like '?e? e??ae ?a???'
  FDTable1.FieldByName('gms_dansk').AsString:= edDansk.Text;
  FDTable1.Post;
end;

Regards
Lars

-Oprindelig meddelelse-
Fra: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] På 
vegne af Clemens Ladisch
Sendt: 7. august 2017 10:28
Til: sqlite-users@mailinglists.sqlite.org
Emne: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

Lars Frederiksen wrote:
> I have followed 2 tutorials about SQLite, and none of these mentioned the 
> VARCHAR() possibility

Because SQLite pretty much ignores column types.
Interpreting "VARCHAR" this way is how FireDAC does things; you have to look 
into the FireDAC documentation.

> But I also realized that it is not possible just to put some greek (unicode) 
> characters into a field. It ends up with a mix of latin chars and 
> questionmarks.
> Is there a (simple) solution on this problem?

Yes: fix the bugs in your code (which you have not shown).


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Lars Frederiksen
Hi,

My code is simple. FDConnection, FDQuery, DataSource + DBGrid, 3 Edits and a 
button. Then this OnClick event:

Procedure TForm1.Button1Click(Sender: TObject);
begin
  FDTable1.Open;
  FDTable1.Append;
  FDTable1.FieldByName('gms_id').AsInteger:= StrToInt(edNummer.Text);
  FDTable1.FieldByName('gms_graesk').AsString:= edGræsk.Text; // this is greek 
letters but in DBGrid it is something like '?e? e??ae ?a???'
  FDTable1.FieldByName('gms_dansk').AsString:= edDansk.Text;
  FDTable1.Post;
end;

Regards
Lars

-Oprindelig meddelelse-
Fra: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] På 
vegne af Clemens Ladisch
Sendt: 7. august 2017 10:28
Til: sqlite-users@mailinglists.sqlite.org
Emne: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

Lars Frederiksen wrote:
> I have followed 2 tutorials about SQLite, and none of these mentioned the 
> VARCHAR() possibility

Because SQLite pretty much ignores column types.
Interpreting "VARCHAR" this way is how FireDAC does things; you have to look 
into the FireDAC documentation.

> But I also realized that it is not possible just to put some greek (unicode) 
> characters into a field. It ends up with a mix of latin chars and 
> questionmarks.
> Is there a (simple) solution on this problem?

Yes: fix the bugs in your code (which you have not shown).


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Clemens Ladisch
Lars Frederiksen wrote:
> I have followed 2 tutorials about SQLite, and none of these mentioned the 
> VARCHAR() possibility

Because SQLite pretty much ignores column types.
Interpreting "VARCHAR" this way is how FireDAC does things; you have to look
into the FireDAC documentation.

> But I also realized that it is not possible just to put some greek (unicode) 
> characters into a field. It ends up with a mix of latin chars and 
> questionmarks.
> Is there a (simple) solution on this problem?

Yes: fix the bugs in your code (which you have not shown).


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Hick Gunter
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Lars Frederiksen
Gesendet: Montag, 07. August 2017 09:00
An: 'SQLite mailing list' <sqlite-users@mailinglists.sqlite.org>
Betreff: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

...
But I also realized that it is not possible just to put some greek (unicode) 
characters into a field. It ends up with a mix of latin chars and questionmarks.
Is there a (simple) solution on this problem?

...

This is most probably caused by inserting UTF encoded characters into an ISO 
string and then performing an ISO to UTF translation, or vice versa, somewhere 
outside of SQLite.

SQLite will assume that any string passed in is UTF coded and faithfully 
reproduce whatever was passed in. The only conversions that happen are when you 
explicitly convert among UTF8, UTF16BE and UTF16LE.


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Lars Frederiksen
Thank you Clemens! 

I am trying to learn FireDAC and SQLite, indeed a steep learning curve!
I just realized that it is possible to replace TEXT with VARCHAR(). I have 
followed 2 tutorials about SQLite, and none of these mentioned the VARCHAR() 
possibility 
But I also realized that it is not possible just to put some greek (unicode) 
characters into a field. It ends up with a mix of latin chars and questionmarks.
Is there a (simple) solution on this problem? 

Regards
Lars

-Oprindelig meddelelse-
Fra: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] På 
vegne af Clemens Ladisch
Sendt: 7. august 2017 08:33
Til: sqlite-users@mailinglists.sqlite.org
Emne: Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

Lars Frederiksen wrote:
> CREATE TABLE gms(
> gms_id INTEGER PRIMARY KEY,
> gms_verb TEXT NOT NULL
> );
>
> FDTable1.Append;
> FDTable1.FieldByName('gms_verb').AsString:= Edit1.Text; FDTable1.Post;
>
> But when I put a string in the table 'gms_verb' I only get the primary 
> key number - the string is shown like (WIDEMEMO).

In SQLite, all text values are Unicode and can have an arbitrary size, so 
dtWideMemo is what FireDAC thinks is the best match.

You could use a different type name, or set up a type mapping:
http://docwiki.embarcadero.com/RADStudio/XE7/en/Using_SQLite_with_FireDAC#SQLite_Data_Types


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-07 Thread Clemens Ladisch
Lars Frederiksen wrote:
> CREATE TABLE gms(
> gms_id INTEGER PRIMARY KEY,
> gms_verb TEXT NOT NULL
> );
>
> FDTable1.Append;
> FDTable1.FieldByName('gms_verb').AsString:= Edit1.Text;
> FDTable1.Post;
>
> But when I put a string in the table 'gms_verb' I only get the primary key
> number - the string is shown like (WIDEMEMO).

In SQLite, all text values are Unicode and can have an arbitrary size, so
dtWideMemo is what FireDAC thinks is the best match.

You could use a different type name, or set up a type mapping:
http://docwiki.embarcadero.com/RADStudio/XE7/en/Using_SQLite_with_FireDAC#SQLite_Data_Types


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] TEXT shows as (WIDEMEMO) in DBGrid

2017-08-06 Thread Lars Frederiksen
Hi,
I am using Delphi 10.1 and I am trying to learn how to handle FireDAC with
SQLite as a database. Beeing used to ADO and Access I find the learning
curve a bit steep!

My simple project:
I have build a simple SQLite database with only 2 fields: a primary key
integer and a text field, like this:

CREATE TABLE gms(
gms_id INTEGER PRIMARY KEY,
gms_verb TEXT NOT NULL
);

I have placed FDConnection, FDTable and DataSource + DBGrid and DBNavigator.
An Edit and a button with this OnClick code:

procedure TForm1.Button1Click(Sender: TObject);
begin
FDTable1.Append;
FDTable1.FieldByName('gms_verb').AsString:= Edit1.Text;
FDTable1.Post;
end;

But when I put a string in the table 'gms_verb' I only get the primary key
number - the string is shown like (WIDEMEMO). 

Any explanation of this?

Best Regards
Lars 

 

 

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users