title: Failing to update a table
body: <p>I have a boolean field in cxGrid (represented as a checkbox inside the grid).
  I am trying to do an update of the very same record when user sets the checkbox as checked.</p>
  
  <p>I tried this:</p>
  
  <pre><code>procedure TDataModule3.ABSTable2BeforePost(DataSet: TDataSet);
  begin
  if DataModule3.ABSTable2.FieldByName('DONE').AsBoolean = True then
  with Datamodule3.ABSQuery4 do begin
  Datamodule3.ABSQuery4.Close;
  Datamodule3.ABSQuery4.SQL.Clear;
  Datamodule3.ABSQuery4.SQL.Text :='UPDATE MYTABLE SET USER=:a1 where TW_ID =:a2';
  Datamodule3.ABSQuery4.Params.ParamByName('a1').AsString := MainForm.AdvOfficeStatusBar1.Panels[3].Text ;
  Datamodule3.ABSQuery4.Params.ParamByName('a2').AsInteger := Datamodule3.ABSTable2.FieldByName('TW_ID').AsInteger;
  Datamodule3.ABSQuery4.ExecSQL;
  end;
  end;
  </code></pre>
  
  <p>I get :
  First chance exception at $00B6E33F. Exception class $C0000005 with message 'access violation at 0x00b6e33f: read of address 0x000003a0'. Process Project1.exe (4916)</p>
  
  <p>What am I doing wrong ? </p>
  
  <p>Edit: I tried the suggestion.</p>
  
  <p>/</p>
  
  <pre><code>if ABSTable2.FieldByName('Done').AsBoolean = True then
    begin
    ABSQuery4.Close;
    ABSQuery4.SQL.Clear;
    ABSQuery4.SQL.Text :='UPDATE mytable SET user=:a1 where  TW_ID=:a2 ';
    ABSQuery4.Params.ParamByName('a1').AsString := ABSQuery1.FieldByName('USER').asString ;
    ABSQuery4.Params.ParamByName('a2').AsInteger := ABSTable2.FieldByName('TW_ID').AsInteger;
     ABSQuery4.ExecSQL;
    end;
  </code></pre>
  
  <p>I have removed the reference to the main form and added the query  syntax as the AdvOfficeStatusBar1.Panels[3].Text gets its data from it.
  Now I get: Absolute Engine error : The table is locked.</p>