SQLQuery1.edit Why not edit in TIB lazarus / 16-Databases ---------------------------------------------------------------------- Fortuna1 · 2012-05-04 13:22 MyTable1  id      text 100     text1 200     text2 SQLQuery1.Close;  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Text := 'select * from MyTable1  ';  SQLQuery1Open;   SQLQuery1.Edit;  This case is OK work. SQLQuery1.Close;  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Text := 'select * from MyTable1  where(id=''100'')';  SQLQuery1Open;   SQLQuery1.Edit;  In these case  NOT OK (not work); Message is Dataset is read-only. My lazarus IDE 0.9.30.2  linux. ---------------------------------------------------------------------- BigChimp · 2012-05-04 13:33 If queries don't work, it helps if you execute your queries first in a query tool such as flamerobin. Can you run the queries there without problems (I'm guessing you can't). Try leaving out the double quotes around the ID value... ---------------------------------------------------------------------- Fortuna1 · 2012-05-04 16:25 I test  with My lazarus IDE 0.9.30.4  linux. and I test  with My lazarus IDE 0.9.31.0  linux. Al test is alike. MyTable1  id      text 100     text1 200     text2 SQLQuery1.Close;  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Text := 'select * from MyTable1  ';  SQLQuery1Open;   SQLQuery1.Edit; This case is OK work. SQLQuery1.Close;  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Text := 'select * from MyTable1  where(id<>''00'')';  SQLQuery1Open;   SQLQuery1.Edit; And TDBEdit TDBGrit and ... he doesn't allow repairing or update In these case  NOT OK (not work); I think that SQLdb in this case allows to alone looking. Zeoslib allows to repairing in this case allows to alone looking. I have enough of problems with installations of Zeoslib , therefore I am leaving him. Message is Dataset is read-only. ---------------------------------------------------------------------- ludob · 2012-05-06 14:01 What does TIB stand for?  TIBConnection from fpc 2.6.0 modifies without any problems a 'select * from MyTable1  where(id<>''00'')' query. ---------------------------------------------------------------------- Fortuna1 · 2012-05-06 15:17 Select is ok. SQLQuery1.SQL.Text := 'select * from MyTable1  '; SQLQuery1.open; SQLQuery1.edit; In these case      edit  is OK. *************************** TIBConnection from fpc 2.6.0   a 'select * from MyTable1  where(id<>''00'')'  SQLQuery1.SQL.Text := 'select * from MyTable1  where(id<>''00'')';  SQLQuery1Open; I get 2 records. But problem is  edit SQLQuery1.Edit;  When I try edit I get message    Read-only. If I put in " select  " where" then edit not work.  FPC  2.6.0 I test  with My lazarus IDE 0.9.30.4  linux. and I test  with My lazarus IDE 0.9.31.0  linux. ---------------------------------------------------------------------- ludob · 2012-05-06 15:41 The lazarus version isn't important. TIBConnection is part of fpc. I've also tested on linux with 2.6.0 and it works for me. I have a simple table defined as Code: [Select]CREATE TABLE TEST (   ID Integer,   NAME Varchar(40) );and do a Code: [Select]'select * from test where (id<>''00'')'SQLQuery1.Edit doesn't generate an error and I can edit the table in a dbgrid. So there is something else that is different. Can you attach a small test program that shows the problem and the definition (DDL) of MyTable1? Aha. Found the problem. Code: [Select]where(id<>''00'') needs a space between "where" and the "(". The problem is also present in 2.7.1 trunk. I'll report the bug and provide a patch. EDIT: bug report and patch at http://bugs.freepascal.org/view.php?id=21965 ---------------------------------------------------------------------- Fortuna1 · 2012-05-06 19:29 'select * from MyTable1  where(id<>''00'')'; 'select * from MyTable1  where (id<>''00'')'; // (ok) Incredibly. The largest thank you. This was my last barrier that finally leave zeoslib. ---------------------------------------------------------------------- Fortuna1 · 2012-05-10 11:57 'select M.aaa, M.bbb from MyTable1 M ' In these case  NOT OK (not work); Message is Dataset is read-only. My lazarus IDE 0.9.30.2  linux. ---------------------------------------------------------------------- BigChimp · 2012-05-10 12:16 ... perhaps try something like 'select M.aaa, M.bbb from MyTable1 as M ' ---------------------------------------------------------------------- Fortuna1 · 2012-05-10 13:47 'select M.aaa, M.bbb from MyTable1 as M ' Itry this, but is not                NOT OK (not work); Message is Dataset is read-only. My lazarus IDE 0.9.30.2  linux. My lazarus IDE 0.9.30.4  linux. ---------------------------------------------------------------------- BigChimp · 2012-05-10 14:15 Ok, better raise a bug in the bug tracker for both situations then, please. ---------------------------------------------------------------------- ludob · 2012-05-10 14:53 The sqlparser is quite simplistic and when it finds a comma or space in the FROM part it considers multiple tables are involved and sets the dataset to read only. To its defense, aliasing tables is usually not done when only one table is involved. Your query can be easily re- written as Code: [Select]select aaa, bbb from MyTable1 ---------------------------------------------------------------------- Fortuna1 · 2012-05-10 15:16 http://bugs.freepascal.org/my_view_page.php ---------------------------------------------------------------------- BigChimp · 2012-05-10 15:25 Added some notes to the wiki: http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery#Dataset_is_r ead-only ---------------------------------------------------------------------- Fortuna1 · 2012-05-11 05:33 SQLQuery1.SQL.Text := 'select  F.aaa, T.bbb from MyTable1 F,tablele T' SQLQuery1.open; SQLQuery1.CashedUpdates; SQLQuery1.EDIT; ZESOLIB IS THIS ALLOWED TO  in  SQLQuery1.CashedUpdates; ---------------------------------------------------------------------- Lacak2 · 2012-05-11 05:52 sqlDB also allows update resultset from multi-tables selects. But in this case you must provide your own InsertSQL, DeleteSQL, UpdateSQL (see published properties of TSQLQuery). Because it would be difficult to generate them automatically in background ;-) ---------------------------------------------------------------------- Fortuna1 · 2012-05-11 14:41 I am apologising myself. I read through former message badly. Also my English is bad. Ok I try. Thank you. 5 years was using zeoslib. Now work to TIBConnection. It all is little otherwise. Tibconection is very made progress. That separately ( TIBConnection and  TSQLTransaction) very good  solution. Zeoslib  has much worse solution for this problem. Thank you for your explanation. Best regards from solar Slovenia. that separately is very better solution as j sauces solution ---------------------------------------------------------------------- BigChimp · 2012-05-11 15:45 Hi Fortuna1, Thanks for your kind message... hope it works for you. If you have problems, please do feel free to open another thread. I can imagine that after 5 years using a certain component you get used to it a bit Good luck, BigChimp