DBGrid and TSQLQuery lazarus / 16-Databases ---------------------------------------------------------------------- robertkondner · 2017-08-10 21:15 Hi,  Lazarus Newbie here, doing development on Windows 10.  So I have a simple MySQL table up on a server. In my app I added my TMySQLConnection, TSQLQuery, TDataSource and TDBGrid. Hooked together, make active, works, I get my columns and data in the Grid.  If I try to edit a cell in the grid the first KeyPress ends up with exception class 'External SIGSEGV'. Happens at a reference to FDataLink.Edit in the TCustomDBGrid class. There is a big hole in my understanding how DBGrid edits feedback into the dataset when that dataset is a TSQLQuery? Don't TDataset type components take care of all that? I never played much with TSQLQuery. I am kind of an old TTable kind of guy. Question:   Can someone give me the event trail of how DBGrid edits are feed back to the database when using a TSQLQuery? Thanks, Bob K. ---------------------------------------------------------------------- valdir.marcos · 2017-08-10 21:55 Have you read? http://wiki.freepascal.org/SqlDBHowto http://wiki.freepascal.org/MySQLDatabases What versions of Lazarus and MySQL server are you using? ---------------------------------------------------------------------- robertkondner · 2017-08-11 01:12 Hi,  MySQL 5.6   Lazarus 1.6.4   FPC 3.02  I read through those docs and I have looked through all the demos. I didn't find any DBGrids with in grid editing. I cannot figure out why editing in the DBGrid is throwing the exception. I am willing to pay money to get help. I can give someone access to my DB on the web. Thanks, Bob K. ---------------------------------------------------------------------- taazz · 2017-08-11 01:36 Quote from: robertkondner on August 11, 2017, 03:12:42 amHi,  MySQL 5.6   Lazarus 1.6.4   FPC 3.02  I read through those docs and I have looked through all the demos. I didn't find any DBGrids with in grid editing. I cannot figure out why editing in the DBGrid is throwing the exception. You mean that editing outside the dbgrid does not through the exception? place a button on the same form and on its click event write something along the lines of 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   DataSource1.Edit;  does it still raises a sigsegv exception? Just an FYI, sigsegv should never happen in the framework if something does not work then a known exception should be raised. SigSegV is something along the lines of GPF ee the code tried to access something that was not there. There are 3 major causes   1) you are accessing a control with out calling its constructor 1st.   2) you are accessing a control after calling its destructor and   3) the control variable got overwritten from some sort of buffer overflow and now points to an illegal address. I understand that the exception is raised in a portion of the code that it is not yours and it is difficult to find the problem but I would start to make sure that everything is set up correctly at runtime, before calling the edit method. ee some routine to make sure that the datasource.dataset is set to the correct Tsqlquery, the sqlquery connection to the correct database control, the transactions fo both the database and sqlquery are set, generally all the control properties are set appropriately and nothing changes during edit. if everything else fails, you can always create a small sample (the smaller the better) that reproduces the problem and post it here along with some fake data and a minimal schema (only the tables in question and its master/details tables) for us to grind on. Just a heads up the debugger will give you some grief if you try to access properties, so try to find out the internal variables of those properties and use them in a watch instead. ---------------------------------------------------------------------- robertkondner · 2017-08-11 01:46 Hi,  I just took your advice and went and built the same code on a different machine. The exception went away. I rebuilt on a VM, which ran,  and the problem was on another "Real" machine. I will try a compare of the ".dfm" files (the Lazarus version) and see if there was some different setup. I must have fat fingered something somewhere. So Taazz, I owe you a beer for your help. Email me at bob at partsync dot com Bob K.