title: Why small changes make "Access violation at address xxx" error on this delphi code?
body: <p>I have 2 pieces of code :</p>
  
  <ol>
  <li>It works normal</li>
  </ol>
  
  <p></p>
  
  <pre><code>with ADOTemp  do
  begin
    SQL.Clear;
  
    SQL.Add('INSERT INTO documents');
    SQL.Add('(document_date,fk_id_status,money_direction,');
    SQL.Add('paid,addition,saving,fk_id_base,fk_id_user)');
    SQL.Add('VALUES ');
    SQL.Add('(CONVERT(DATE,GETDATE(),103),:pfk_id_status,:pmoney_direction,');
    SQL.Add('0,0,0,'+IntToStr(p_id_base)+',:pfk_id_user)');
  
    Parameters.ParamByName('pfk_id_status').Value := p_id_status;
    Parameters.ParamByName('pmoney_direction').Value := p_money_direction;
    // Parameters.ParamByName('p').Value := p_id_base;
    Parameters.ParamByName('pfk_id_user').Value := fMain.ApplicationVariablers.user_id;
  
    ExecSQL;
  end;
  </code></pre>
  
  <ol start="2">
  <li>It does not work and returns a terrible error</li>
  </ol>
  
  <p></p>
  
  <pre><code>with ADOTemp  do
  begin
    SQL.Clear;
  
    SQL.Add('INSERT INTO documents');
    SQL.Add('(document_date,fk_id_status,money_direction,');
    SQL.Add('paid,addition,saving,fk_id_base,fk_id_user)');
    SQL.Add('VALUES ');
    SQL.Add('(CONVERT(DATE,GETDATE(),103),:pfk_id_status,:pmoney_direction,');
    SQL.Add('0,0,0,:p,:pfk_id_user)');
  
    Parameters.ParamByName('pfk_id_status').Value := p_id_status;
    Parameters.ParamByName('pmoney_direction').Value := p_money_direction;
    Parameters.ParamByName('p').Value := p_id_base;
    Parameters.ParamByName('pfk_id_user').Value := fMain.ApplicationVariablers.user_id;
  
    ExecSQL;
  end;
  </code></pre>
  
  <p>Error on image, line 1917</p>
  
  <p><a href="https://i.stack.imgur.com/Uyov5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uyov5.png" alt="enter image description here"></a></p>