预览按钮代码如下:
//connect database
  frxReport2.LoadFromFile('Report.fr3');
  frxReport2.ShowReport();
第一次点击没问题,关闭预览窗口再点一次就报错:access violation...如何解决?不能换版本重装。

解决方案 »

  1.   

    //connect database
      frxReport2.LoadFromFile('Report.fr3');
      frxReport2.ShowReport();
    //加入清空报表的代码
      

  2.   

    frxReport2.clear;
    frxReport2.LoadFromFile('Report.fr3');
      frxReport2.ShowReport();
      

  3.   

    mmgbd,下午莫名其妙的又没问题了,我确实什么也没改,加的唯一一句frxReport2.clear;因为不行也删掉了,坐在那郁闷了半个多小时,再一点,没问题了,简直莫名其妙