[Solved] Mysql to Sqlite3 lazarus / 16-Databases ---------------------------------------------------------------------- jeanchristophe · 2012-05-09 10:00 Hello, I try to move a mysql database to sqlite3. As the project is not that big, I move one table at the time. I am using zeos for the mysql database. Zeos: connection, table and datasource. Sqlite: connection and datasource. I try to write this: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var countrecord: longint; recordnumber: longint; begin   countrecord:= Ztable1.RecordCount;   Button1.Caption:= inttostr (countrecord);   for recordnumber:=0 to (countrecord - 1) do   begin      ZTable1.RecNo:= recordnumber;      Sqlite3Dataset1.Insert;      Sqlite3Dataset1.IndexFields[0].AsString:=ZTable1.FieldByName('Nog le').AsString;      Sqlite3Dataset1.Post;   end end;        All that I got is an exception class: Code: [Select]External SIGSEGV I am aware that the code is not the best, but it's compile fine. Can you please tell me where I should look? Thank you Best Regards Jean-Christophe ---------------------------------------------------------------------- marcov · 2012-05-09 10:03 Quote from: jeanchristophe on May 09, 2012, 12:00:32 pmCode: [Select]      Sqlite3Dataset1.IndexFields[0].AsString:=ZTable1.FieldByName('Nogl e').AsString; Why "indexfields" on the left, and fieldbyname on the right ? I don't get that. Both fieldbyname (or fields[0]), but indexfields? That is afaik something else (fields with indexes on them?) ---------------------------------------------------------------------- jeanchristophe · 2012-05-09 10:21 Sorry, my mistake!  I changed the line to: Code: [Select]Sqlite3Dataset1.FieldByName('Nogle').AsString:=ZTable1.F ieldByName('Nogle').AsString; The application is now running, but nothing is written in the sqlite table! I keep looking. Thanks for your (fast) help Marcov Best Regards Jean-Christophe ---------------------------------------------------------------------- ludob · 2012-05-09 10:49 To store the data in the sqlite database you need to call  TSqlite3Dataset.ApplyUpdates or set TSqlite3Dataset.SaveOnClose to True. http://wiki.freepascal.org/Lazarus_Database_Tutorial#Using_the_TSQLite 3Dataset ---------------------------------------------------------------------- jeanchristophe · 2012-05-09 12:08 Thank you very much for your answer Ludob. It is now working!  Best Regards Jean-Christophe