title: Delphi system error code 5 access denied
body: <p>I created a thread and it works good when <code>Preview=false</code>, but when I set <code>Preview=true</code> then I always get an error (system error code 5 access denied). </p>
  
  <p>I want to thread the report because it takes more than 10 seconds to generate. </p>
  
  <p>Can somebody explain what is going on?</p>
  
  <pre><code>procedure TReportThread1.Execute;
  begin       
      if ReportBUFFER = 1 then begin
          dm.rmvFarm.Filename := reportpath + 'aoc.rep';
          dm.rmvFarm.Report.Params.Items[0].Value := Thread_StartOfTheDayR1;
          dm.rmvFarm.Report.Params.Items[1].Value := Thread_EndOfTheDayR1;
          dm.rmvFarm.Report.Params.Items[2].Value := currentusr;
          dm.rmvFarm.Preview := true;
          dm.rmvFarm.Execute;
  
          ReportThread1.free;
      end;                                                 
  end.
  </code></pre>