Data from SQLite lazarus / 16-Databases ---------------------------------------------------------------------- amedeo · 2019-11-23 12:39 Hallo, sorry for may bad english. I am doing my first DB using Lazarus+SQLite and I have a ploblem showing data in a TDBGrid. I build DB and TABLE using "DB Browser for SQLite" and I populated the TABLE with 3 recors. It is ok, I saw it. In Lazarus I build the application with one form and: TSQlite3Connection, TSQLTransaction, TSQLQery, TDataSorce and a TDBGrid with all this objects connected, I thik, well. I see all columns and the correct numbers of rows and the value of the first field that is a interger AutoIncrement, in the remaining fields of the TDBGrid I see just "MEMO". Someone can help me to understand and solve this problem? Thaks ---------------------------------------------------------------------- fmc · 2019-11-23 13:26 Try this: Click on your DBGrid and go to your Object Inspector. Scroll down and click Options, then tick dgDisplayMemoText.  It's been a while since I used the stock DBGrid that comes with Lazarus, but I think that'll do the trick for you. Btw, your English is fine. ---------------------------------------------------------------------- Zvoni · 2019-11-23 13:42 And don't use AUTOINCREMENT on your Primary Key in SQLite ---------------------------------------------------------------------- fmc · 2019-11-23 14:11 To further Zvoni's reply, this is how it works: If you have a table that's: 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 CREATE TABLE IF NOT EXISTS customers(    cust_id INTEGER PRIMARY KEY,     cust_fname VARCHAR(20),     cust_lname VARCHAR(20)); the cust_id column will increment on its own. However if the table drops all rows, it starts from the beginning again. As where if you use: 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 CREATE TABLE IF NOT EXISTS customers(    cust_id INTEGER PRIMARY KEY AUTOINCREMENT,     cust_fname VARCHAR(20),     cust_lname VARCHAR(20)); and dropped a row (or all of them again), it will start with the last cust_id that was in use. That's the difference. So either works fine. ---------------------------------------------------------------------- valdir.marcos · 2019-11-23 14:12 Quote from: amedeo on November 23, 2019, 01:39:31 pmHallo, sorry for may bad english. I am doing my first DB using Lazarus+SQLite and I have a ploblem showing data in a TDBGrid. I build DB and TABLE using "DB Browser for SQLite" and I populated the TABLE with 3 recors. It is ok, I saw it. In Lazarus I build the application with one form and: TSQlite3Connection, TSQLTransaction, TSQLQery, TDataSorce and a TDBGrid with all this objects connected, I thik, well. I see all columns and the correct numbers of rows and the value of the first field that is a interger AutoIncrement, in the remaining fields of the TDBGrid I see just "MEMO". Someone can help me to understand and solve this problem? ThaksIt will be easier to help you, if you attach a small sample project. Maybe, you should review your SQLite's table structure. ---------------------------------------------------------------------- Zvoni · 2019-11-23 14:42 Quote from: fmc on November 23, 2019, 03:11:57 pmTo further Zvoni's reply, this is how it works: If you have a table that's: 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 CREATE TABLE IF NOT EXISTS customers(    cust_id INTEGER PRIMARY KEY,     cust_fname VARCHAR(20),     cust_lname VARCHAR(20)); the cust_id column will increment on its own. However if the table drops all rows, it starts from the beginning again. As where if you use: 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 CREATE TABLE IF NOT EXISTS customers(    cust_id INTEGER PRIMARY KEY AUTOINCREMENT,     cust_fname VARCHAR(20),     cust_lname VARCHAR(20)); and dropped a row (or all of them again), it will start with the last cust_id that was in use. That's the difference. So either works fine. Yes, to a degree. The amount of data not withstanding, why i prefer no AUTOINCREMENT in SQLite: From the SQLite-Dox: Quotef a column has the type INTEGER PRIMARY KEY AUTOINCREMENT then a slightly different ROWID selection algorithm is used. The ROWID chosen for the new row is at least one larger than the largest ROWID that has ever before existed in that same table. If the table has never before contained any data, then a ROWID of 1 is used. If the largest possible ROWID has previously been inserted, then new INSERTs are not allowed and any attempt to insert a new row will fail with an SQLITE_FULL error. Only ROWID values from previous transactions that were committed are considered. ROWID values that were rolled back are ignored and can be reused. ---------------------------------------------------------------------- amedeo · 2019-11-23 16:42 Solved. A lot of thanks, the proble is just to check an option ---------------------------------------------------------------------- fmc · 2019-11-23 16:46 Yeah