sqlite lazarus / 16-Databases ---------------------------------------------------------------------- moessner · 2017-04-16 13:50 I wish thank you for the interesting. I have this problem : I try to connect a database with a sqlconnector or a sqlite3connection but when I active the connection and the sqlquery don't connect the dataset. The error is : no such table for the component connection. I wish specify that I have also a component sqltransaction on the form and a datasource. Thank to all wish to help me. moessner ---------------------------------------------------------------------- valdir.marcos · 2017-04-16 14:34 Are you using the latest Lazarus 1.6.4 and FPC 3.0.2? Have you read ? http://wiki.freepascal.org/SQLdb_Tutorial1 http://forum.lazarus.freepascal.org/index.php?topic=16852.0 http://wiki.freepascal.org/SQLite https://www.sqlite.org/docs.html Zip a small test project (without binary) and attach to this thread, so we can easily understand what is happening. ---------------------------------------------------------------------- moessner · 2017-04-16 16:11 Thank for helping. I use lazarus 1.6.4. . I have a dbgrid connected to a normal dataset connected to sqllite3conncection connected to sqltransaction. i try to active all the components in this mode: procedure TForm1.FormActivate(Sender: TObject); begin   sqlquery1.active := true ;   Sqlite3Connection1.databasename := "c:\db\Nuovo_DB.DB" ;   Sqlite3Connection1.connected := true ;   Sqltransaction1.active := true ; end;  Many thanks moessner ---------------------------------------------------------------------- Thaddy · 2017-04-16 16:50 You set things "active" (not just database components) when you have completed the setup of things and they need to start some kind of job.... Now. Change your workflow order and see if it helps... ---------------------------------------------------------------------- valdir.marcos · 2017-04-16 21:23 Quote from: Thaddy on April 16, 2017, 06:50:05 pmYou set things "active" (not just database components) when you have completed the setup of things and they need to start some kind of job.... Now. Change your workflow order and see if it helps... Quote from: moessner on April 16, 2017, 06:11:34 pmprocedure TForm1.FormActivate(Sender: TObject); begin   sqlquery1.active := true ;   Sqlite3Connection1.databasename := "c:\db\Nuovo_DB.DB" ;   Sqlite3Connection1.connected := true ;   Sqltransaction1.active := true ; end;  As Thaddy said, be careful with component sequence of activation. Be also careful with the differences among the events FormCreate and FormActivate: https://www.thoughtco.com/life-cycle-of-a-delphi-form-1058011 http://www.askingbox.com/info/delphi-event-order-of-a-form-from- oncreate-to-ondestroy Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormCreate(Sender: TObject);begin  SQLite3Connection1.DatabaseName := "c:\db\Nuovo_DB.db" ;  SQLite3Connection1.Connected := True ;    SQLTransaction1.Database := SQLite3Connection1;  SQLTransaction1.Active := True ;    SQLQuery1.Database := SQLite3Connection1;  SQLQuery1.Transaction :=  SQLTransaction1;  SQLQuery1.SQL.Text := 'Select * From TableName Order By FieldName1';  SQLQuery1.Active := true ;    // -> doubleclick on SQLQuery1 component  // -> click on + sign to add tablefields    // just in case you use dbware components  DataSource1.Dataset := SQLQuery1;    DBEdit1.DataSource := DataSource1;  DBEdit1.DataField := 'FieldTestName';end; ---------------------------------------------------------------------- moessner · 2017-04-16 22:33 I wish thank you for the answer. But i don't understand  what is tablename. It seems a Alias but where i can set it up Thank you ---------------------------------------------------------------------- valdir.marcos · 2017-04-16 23:18 I don't know the structure of your tables on "c:\db\Nuovo_DB.DB", so I used "TableName" and FieldName1" just as a way to indicating for your where you would put the name for your table and the names of the fields to ordinate your query. Just in case you are also starting on SQLite, here you can find a fast course: https://www.tutorialspoint.com/sqlite/sqlite_select_query.htm And here another one for Pascal: https://www.tutorialspoint.com/pascal/index.htm ---------------------------------------------------------------------- moessner · 2017-04-17 01:32 Thanks a lot Moessner ---------------------------------------------------------------------- moessner · 2017-04-17 02:26 I have open the database ! ! ! Thank you Thank you Thank you Thank you Thank you ---------------------------------------------------------------------- jma_sp · 2017-04-17 07:22 Also, you can use lazsqlx to modify your SQLite table(s) into database easily or see existing tablenames: https://sourceforge.net/projects/lazsqlx/?source=directory Or with: https://github.com/sqlitebrowser/sqlitebrowser/releases