Update works only once for every record lazarus / 16-Databases ---------------------------------------------------------------------- Pccare247 · 2013-11-02 00:50 I'm back again and i'm so sorry but i have another problem. I can't edit for a second time a record. Let me explain, Open my database and find the desire record i edit an post once and works fine, but if i try to edit the same record again it does do nothing. No message or anything else That happens to all table of my database not just this one To my other table i'm using a grid to edit the records The way i use to find a record if it can't find the record Inserts a new procedure TForm3.Edit1Exit(Sender: TObject); begin  Sqlite3Dataset1.sql:='SELECT * FROM pelates WHERE code='+Edit1.text+';';  Datasource1.DataSet.open;  Datasource2.DataSet.open;  Datasource3.DataSet.open;  Datasource4.DataSet.open;      with Datasource1.Dataset do      begin        If Sqlite3Dataset1code.text=edit1.text then         begin          SQLite3Dataset1.edit;         end;       If Sqlite3Dataset1code.text<>edit1.text then        begin         SQLite3Dataset1.insert;         FieldByName('code').AsString         :=Edit1.Text;         FieldByName('Area').AsString         :='11025';         FieldByName('city').AsString         :='9000';         FieldByName('Sales_man').AsString    :='2004';         FieldByName('Category').AsString     :='299';         FieldByName('Comnunication').AsString:='Δεν εχουμε επικοινωνήσει';        end;      end;  end;                      and the way i Post the Record procedure TForm3.Button1Click(Sender: TObject); begin  Sqlite3Dataset1.post;  Sqlite3Dataset1.ApplyUpdates;  datasource1.dataset.close;  Edit1.setfocus; end;