DBNavigator .. DBGrid lazarus / 16-Databases ---------------------------------------------------------------------- jonas shinaniganz · 2011-09-12 08:51 Hi Everyone! I am posting this cause there isnt a good guide / documentation / manual for the whole SQLQuery thingy. I established a connection to my MySQL5 - Database with the standart components. I have a tabel (name: test) with 2 rows of varchar(45) and 1 row, thats PrimKey autoINC. In my main project i already created various composition - classes for the Query, Connection, Datasource and Transaction. But for this example i just pulled the 4 visibel components on my Form. So i linked the components with each other in the way you can read it everywhere... And with the: Code: [Select]select * from test I get my DBGrid filled with Data! So up to now nothing special.. rly just a few siiiimpel clicks. Now i really want to get the DBNavigator to work. I pulled the Navigator on the Form and linked it with my Datasource1. (i dint even change the Names jet to keep it even more Simpel) Thats all i have done so far. Ofcourse i tryed a thousand pointless things, but for now this is a new start and in this project nothing is done besides the stuff i told you.  When i compile my prog the refresh, and the navigation buttons work. The rest doesnt. Well lets say it works but after i changed some data and added a row or deleted a row the changes or the new inserts dont apply to the database! Now i figgured that i have to : Code: [Select] SQLQuery1.ApplyUpdates;Whats the best place/time to call this method?? But isnt there something like an AutoApply? Also in some cases i get the Error: Query is not in an Insert or Edit state. So i tryed SQLQuery1.Edit; or SQLQuery1.Insert; on my Form create... But it doesnt help. Also i dont know what is going on. Also i would love to know whats the diffrence between and open method and ExecSQL method. What is ment by that? Please give me an example. When reading the text below from the http://wiki.lazarus.freepascal.org/MySQLDatabases#TSQLQuery articel i feel like im really close to the solution but i just dont have any plans on how to proceed. Pls help! QuoteTSQLQuery is used to execute SQLstatements on the server. You can retrieve data by setting the SQL to some SELECT statement and call the Open method. Or you can manipulate data by issuing some an INSERT, DELETE or UPDATE statement. In the latter case you should not use the Open method but the ExecSQL method. And remember, for now my only goal is to make use of the most basic functions of the DBNavigator! Lets solve that one first bevore doing anything else, please!  The Question: What more todo then set the Datasource of the DBNavigator1 to get it work. Thanks already for reading, and thanks even more for resp! Greetings from germany. ---------------------------------------------------------------------- goodname · 2011-09-12 17:44 http://wiki.lazarus.freepascal.org/SQLdb_Package http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery ApplyUpdates are useful in the afterPost and afterDelete events. Often followed by SQLTransaction.commit. Place your ExecSQL and Open commands in try blocks. Place SQLTransaction.rollback in the except part of the blocks. Open is for queries that expect a result set to be returned. ExecSQL is for queries that don't expect a result set. ---------------------------------------------------------------------- jonas shinaniganz · 2011-09-14 06:54 Thank you.