1.6.2 Crashing with various error messages lazarus / 16-Databases ---------------------------------------------------------------------- KarenT · 2017-05-22 23:13 Having moved over to Linux a week or so back, I am re-writing some Delphi programs, not actually porting them or using the "Tools-Delphi" options, but a lot of stuff is copyable across. Using SQLdb and nothing fancy going on, I am getting errros/crashes that change. When opening a specific sub-Form, I empty a Table and sometimes get "Cannot perform that on a closed dataset." But then at other times I get "Dataset is read only" and then again, "cannot perform that on an active dataset." If I click "Break" on the error message it takes me to different places in the source, rarely the same spot. It seems to have scrambled it's brains. I can open and change data in the Firefox Sqlbrowser OK. I checked the Ubuntu/Mint file permissions and all three levels are "Read and write". Tried a full rebuild same problem. The weird thing is this used to work and I have not changed anything in that section since it was working a two days back. 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 TblClear(const sqlQry : TSQLQuery);begin  if sqlQry.RecordCount > 0 then // It is OK until this line then breaks and    begin                                       // throws me to somewhere else in the source    sqlQry.Last;    while not(sqlQry.BOF) do      sqlQry.Delete;  end;end; ---------------------------------------------------------------------- talorigomat · 2017-05-23 09:49 Check whether elsewhere in your code you have not changed the state of the dataset before calling your function to clear the table. Cannot perform that on a closed dataset. - Check whether you are commiting data and not reopening the TSQLQuery.  If you have set the property sqoKeepOpenOnCommit  to True then you wouldn't need to reopen the dataset after a commit. Dataset is read only - is the dataset pulling information from two or more tables? ---------------------------------------------------------------------- KarenT · 2017-05-23 14:43 Thank you, I will check.