Dbgrid shows strange characters  lazarus / 16-Databases ---------------------------------------------------------------------- Ericktux · 2016-06-01 16:52 Good Day my friends, when I add data to DBGRID this shows strange characters  Why...?? (attached image) ---------------------------------------------------------------------- rvk · 2016-06-01 17:01 What kind of values did you expect in those fields? You need to supply some more information: What underlying database? What charset is defined in that database? Which dataset-component did you use? What charset did you supply with the database-connection component? What version of Lazarus do you use? What OS do you use? What kind of field is Garantia (in the database and in the field- editor)? ---------------------------------------------------------------------- Ericktux · 2016-06-01 17:10 Im Sorry my friend, this are my values: * SQLdb component * Sqlite database * Component TDbgrid * SQLQuery1 * Datasource1 from "Data Acces" component * Lazarus 1.6 32bits * Win10x64 What is "charset" my friend...?? PD: I expected values string. ---------------------------------------------------------------------- Ericktux · 2016-06-01 17:14 When i open the database with SQLiteStudio, all database is correct, thats strange ---------------------------------------------------------------------- rvk · 2016-06-01 17:16 Quote from: Ericktux on June 01, 2016, 07:10:43 pmWhat is "charset"? UTF-8 or iso-8859-1 or something else. Those components are all standard so it's strange you have this result. Is you used TSQLConnector in SQLdb you have Charset all the way at the top in the Object Inspector. This should be set to the same charset as when you created the database. ---------------------------------------------------------------------- rvk · 2016-06-01 17:20 Ah, I think I'm beginning to see the problem. Your Garantia field is actually an integer field. I think somehow it's a TStringField in Lazarus. Could you remove the defined fields in the TSQLQuery-component (rightclick and choose Edit fields). If you have a TStringfield for Garantia and it's really a Integer in SQLite then you get the result you got. You could try adding all fields again but you could also leave it blank and let Lazarus fill it when the connection is made (only possible if you don't use the fields directly but use FieldByName() in code). ---------------------------------------------------------------------- Ericktux · 2016-06-01 17:38 This my code for create table: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SQLite3Connection1.ExecuteDirect('CREATE TABLE productos     (ID INTEGER PRIMARY KEY AUTOINCREMENT, Producto  STRING, Categoría STRING, Precio REAL, Valor REAL, Garantía INTEGER, Cantidad INTEGER)'); For create the values of tables i using: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i begin SQLQuery1.Close;  SQLite3Connection1.DatabaseName := 'base1.db';  SQLite3Connection1.Connected := True;  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Add('insert into productos (Producto, Categoría, Precio, Valor, Garantía, Cantidad) values (:Producto, :Categoría, :Precio, :Valor, :Garantía, :Cantidad)');  SQLQuery1.Params.paramByName('Producto').AsString      := CBX_PRODUCTO.Text;  SQLQuery1.Params.paramByName('Categoría').AsString     := CBX_CATEGORIA.Text;  SQLQuery1.Params.paramByName('Precio').AsFloat         := StrToFloat(edit_PRECIO_COMPRA.Text);  SQLQuery1.Params.paramByName('Valor').AsFloat          := StrToFloat(edit_PRECIO_VENTA.Text);  SQLQuery1.Params.paramByName('Garantía').AsInteger      := strtoint(edit_GARANTIA.Text);  SQLQuery1.Params.paramByName('Cantidad').AsInteger     := strtoint(edit_CANTIDAD.Text);   SQLQuery1.ExecSQL;  SQLTransAction1.Commit;  SQLQuery1.SQL.text:='Select * FROM productos';  SQLQuery1.open;end; also I did SQLite3Connection1 in property "Charset" = UTF-8 or iso-8859-1, same error ---------------------------------------------------------------------- Ericktux · 2016-06-01 17:57 Thank you very much friend "rvk", the solution is: Delete all items from "Edit Field" from "SQLQuery1"     (attached image) ---------------------------------------------------------------------- LacaK · 2016-06-03 05:50 Btw in your CREATE TABLE statement you use: .... Producto  STRING ... But STRING is not SQL data type (and is not supported directly by sqlDB SQLite), so better if you use CHAR(10) or VARCHAR(10) ... where 10 is maximum character length ---------------------------------------------------------------------- rvk · 2016-06-03 07:47 And STRING is actually mapped to storage class NUMERIC via rule 5 of the "3.1 Determination Of Column Affinity" rules. http://stackoverflow.com/a/11938894/1037511 You just don't notice this directly because you can store text in a numeric-field in SQLite.