SQLite: records do not save [SOLVED] lazarus / 16-Databases ---------------------------------------------------------------------- vice · 2008-10-14 02:12 What other ways exist to establish a primary key in SQLite? I use ftAutoInc and it works fine, but if I use the PrimaryKey propertie the records do not save, why? If I do: Code: [Select]Sqlite3Dataset1.ExecSQL('CREATE TABLE tbl (Code INTEGER NOT NULL PRIMARY KEY, First_Name VARCHAR)'); The records do not save either, why? Best regards. EDIT: The solution: Code: [Select]   with Sqlite3Dataset1 do   begin       TableName := 'tbl';       PrimaryKey := 'Code';       AutoIncrementKey := True;       if not TableExists then         ExecSQL('CREATE TABLE tbl (Code INTEGER NOT NULL PRIMARY KEY, First_Name VARCHAR)');   end;