Cannot update this query type
Posted: 04.03.2022, 11:51
Hi,
My project migrated from the older ZEOS to 7.2.14-release.
Before that, everything was working fine. Currently, I can't change the checkbox status because it ends with the error "Cannot update this query type".
I attach a code snippet in which there is a status change.
I am asking for verification why the previous solution stopped working now and possibly for a hint on how to change the status now.
My project migrated from the older ZEOS to 7.2.14-release.
Before that, everything was working fine. Currently, I can't change the checkbox status because it ends with the error "Cannot update this query type".
I attach a code snippet in which there is a status change.
I am asking for verification why the previous solution stopped working now and possibly for a hint on how to change the status now.
procedure SetDBGrid(selectedSearchByComboIndex: integer); begin if AddScenarioMenu.AddScenarioCategoryListTree.Selected.Text <> 'Parametry' then begin if (AddScenarioMenu.AddScenarioCategoryListTree.Selected.Parent.Text = 'Parametry') and (AddScenarioMenu.AddScenarioCategoryListTree.Selected.Text <> 'Moduły') then lWHEREA:= ' and nops_pop is null ' else if (AddScenarioMenu.AddScenarioCategoryListTree.Selected.Text = 'Moduły') then lWHEREA:= ' and 1 = 1 ' else lWHEREA:= ' and nops_pop is not null '; lWHERE:= ' and nops in (select nops from sops where napp = 22 '+lWHEREA+'start with nazw = '+ ''''+AddScenarioMenu.AddScenarioCategoryListTree.Selected.Text+''''+' connect by prior nops = nops_pop)'; end else lWHERE:= ' and 1 = 1 '; if selectedSearchByComboIndex = 1 then lWHERESEARCH:= ' and upper(nazw) like '+''''+ReplaceStr(AddScenarioMenu.AddScenarioListSearch.Text,'''','''''')+'%'+'''' else if selectedSearchByComboIndex = 0 then begin lWHERESEARCH:= ' and upper(zmie) like '+''''+ReplaceStr(AddScenarioMenu.AddScenarioListSearch.Text,'''','''''')+'%'+'''' end; MenuGlowne.ZQueryPROD.SQL.Text:= 'select zmie as "Zmienna", nazw as "Nazwa",'+sLineBreak+ ' decode(sopd.tpop, ''ST'', ''Tekst'', ''IN'', ''Liczba całkowita'', ''FL'', ''Liczba rzeczywista'','+sLineBreak+ ' ''DT'',''Data'',''LG'',''Wartość logiczna'',''DR'',''Katalog'',''EN'',''Wyliczeniowa'','+sLineBreak+ ' ''IC'',''Zbiór wartości'',''CS'',''Zakodowany tekst'') as "Typ",'+sLineBreak+ ' (case when sopd.tpop = ''LG'' then nvl(doms,''NIE'') when sopd.tpop = ''EN'' then nvl(doms,''0'') when sopd.tpop = ''IN'' then nvl(sopd.doms,''0'') else nvl(doms,''???'') end) as "Wart. domyślna",'+sLineBreak+ ' nvl(decode(substr(dost,5,1),''1'',''O'','''')||decode(substr(dost,4,1),''1'',''S'','''')'+sLineBreak+ ' ||decode(substr(dost,3,1),''1'',''M'','''')||decode(substr(dost,2,1),''1'',''R'','''')'+sLineBreak+ ' ||decode(substr(dost,1,1),''1'',''N'','''')||decode(wrzm,''N'','''',''T'',''W''),'' '') as "Określone",'+sLineBreak+ ' ''0'' as "Status"'+sLineBreak+ 'from sopd'+sLineBreak+ 'where napp = 22'+sLineBreak+ lWHERE+sLineBreak+ lWHERESEARCH+sLineBreak+ 'order by zmie'; ; MenuGlowne.ZQueryPROD.Active:= true; AddScenarioMenu.AddScenarioOptionListDataSource.DataSet:= MenuGlowne.ZQueryPROD; while not AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.EOF do begin AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.Fields[5].ReadOnly:= false; AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.Edit; AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.FieldByName('Status').AsString:= IsCheckedZMIE(AddScenarioMenu.CheckedRows,AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.FieldByName('Zmienna').AsString); AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.Post; AddScenarioMenu.AddScenarioOptionListDataSource.DataSet.Next; end; AddScenarioMenu.AddScenarioOptionListDBGrid.DataSource:= AddScenarioMenu.AddScenarioOptionListDataSource; end;the problem is in the bold part of the code, it worked before