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:
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:
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;