SQLite3Connection.databasename make exception "external SIGSEGV" lazarus / 16-Databases ---------------------------------------------------------------------- vs99 · 2014-11-20 20:05 Hello, I have problem with copile project on Win with SQLite. SQLite3Connection.databasename:='test.db'; - make exception "external SIGSEGV". If I have the same code in MainForm, all do normally. But I move code to second unit and from Unit1 call any procedures and functions with SQLite3connection, appears exception.  Anyone have an idea? Thanks Vladimir ---------------------------------------------------------------------- fpcoder · 2014-11-20 21:58 Vladimir, "External SIGSEGV" usually means that the object you are trying to access is not created yet. So check where you create SQLite3Connection. (what form and when) DataModules are good places to keep these things and also separate database code from the rest of the program. I usually put my Connection (named Conn) and Transaction (named TX) in a DataModule (named DM) and call: Code: [Select]DM.Conn.DatabaseName:= 'somedb'; If you do that, I suggest go to project options -> Forms and move the datamodule up in the creation-list so it is created first of all. Then you can access all the datamodule objects from any form that has your datamodule in its uses clause. ---------------------------------------------------------------------- tudi_x · 2014-11-20 22:00 Hi, Had the same issue. Switched to Zeos components and no issue. Example below: Code: [Select]constructor Query.Create(TheDBFile, TheSQLiteDLL : string);     begin       db_filename := TheDBFile;       db_driver   := TheSQLiteDLL;     end;     function Query.RunQSQLite(AQuery : string) : boolean;     begin         ZConnSQLite                := TZConnection.Create(nil);         ZConnSQLite.Protocol   := 'sqlite-3';         ZConnSQLite.Database  := db_filename;         ZConnSQLite.LibraryLocation:= db_driver;         ZConnSQLite.Connect;         Result := ZConnSQLite.ExecuteDirect(AQuery);         ZConnSQLite.CleanupInstance;         ZConnSQLite.Disconnect;         ZConnSQLite.FreeInstance;     end; ---------------------------------------------------------------------- vs99 · 2014-11-20 23:51 Thansk for all!  I went through by Kapibara. It worked. Info for others - after moving "DB Form" over "Main form" in Project options you must create action "OnShow" on "DBForm" and put in to DBForm.visible:=false; Otherwise DBForm wil show on top application.