SQLite Console Application lazarus / 16-Databases ---------------------------------------------------------------------- Kyshuo Ayame · 2015-09-03 17:06 I need to create a console application in pascal that is capable of using a SQLite database. I only managed to do so by Forms, but not by console. To use the same code used by Forms throws the exception 'External: SIGSEGV'. I do not need to use windows in my application, should be console. How I can connect to SQLite3 by simply source code? Is not there something similar to the used in Java or C ++? Thank you. ---------------------------------------------------------------------- Leledumbo · 2015-09-03 17:31 What you can do by GUI can be done in console, too. SQLdb, despite having droppable components, are usable in non-GUI environment. A snippet from my lib: Code: [Select]uses   db, sqldb, sqlite3conn; var   Conn: TSQLConnector;   Trans: TSQLTransaction;   Query: TSQLQuery; begin   Conn := TSQLConnector.Create(nil);   with Conn do begin     ConnectorType := 'SQLite3';     HostName := ''; // not important     DatabaseName := '/path/to/sqlite/db/file';     UserName := ''; // not important     Password := ''; // not important   end;   Trans := TSQLTransaction.Create(nil);   Conn.Transaction := Trans;   Query := TSQLQuery.Create(nil);   Query.DataBase := Conn;   Query.SQL.Text := 'insert your sql query here';   // Query.ParamByName('...').AsWhatever := ... fill if you use parameterized query   Query.ExecSQL; // or Query.Open; depending whether your query is select or not     // for select query   // while not Query.EOF do begin   // do whatever you want, access row field with Query.FieldByName('...').AsWhatever   //   Query.Next;   // end;   // Query.Close;   // for non-select   Trans.Commit; end. I use TSQLConnector for easy switching between supported connections, nothing stops you from directly using TSQLite3Connection. Direct SQLite API calls are also possible (see packages/sqlite/tests for sample programs). ---------------------------------------------------------------------- Kyshuo Ayame · 2015-09-03 19:31 Thank you!!!!!!! You are a genious!!!! It worked very well. ¿Have you got any material that could recommend the use of SELECT statements, INSERT and UPDATE? I researched a lot on the Web and there is nothing useful. Only when I posted the question here I could fix the problem. Many thanks.