problem with TSQLQuery lazarus / 16-Databases ---------------------------------------------------------------------- tiberi72 · 2011-02-16 15:25 Hello, can anyone help me? I write this code:   MyDb2:= TIBConnection.Create(Nil);   MyTrans2 := TSQLTransaction.Create(Nil);   MySql2:= TSQLQuery.Create(Nil);   Mydb2.Databasename := 'C:\Archivio.fdb';   Mydb2.UserName := 'SYSDBA';   MyDb2.PassWord := 'masterkey';   MyDb2.Transaction := MyTrans2;   MyDb2.Connected := True;   MyTrans2.DataBase := MyDb2;   MyTrans2.active := true;   MyTrans2.action := caCommit;   MySql2.Database :=Mydb2;   MySql2.Transaction := MyTrans2;   Mysql2.ReadOnly := false;                      S :='INSERT INTO MITTENTI ( CODICE, RAGSOC, INDIRIZZO, CITTA, CAP, ';           S := S + 'PROVINCIA, NAZIONE, PI, CODICECOMMITTENTE, AGGIORNATO, OP1, ';           S := S + 'OP2, ALIAS, DISABILITATO, UTENTEINTERNET, FLAGARCHIVIAZIONE) ';           S := S + 'VALUES( ''';           S := S + MySql1.FieldByName('ANATIP').AsString ; .... ....           S := S + ''')';                      Mysql2.sql.text:= S;              Mysql2.Execsql;    But  after this I can't find the new record in the table. Why? ---------------------------------------------------------------------- JimBeam · 2011-02-16 16:55 Wild guess: you might need to explicitly commit the transaction e.g. with MyTrans2.action.commit. Note: I haven't looked at what your code MyTrans2.action := caCommit does, so sorry if the guess is wrong...