Search code examples
delphidelphi-5fastreport

EOF Error Delphi fast report 4


Help!!! When I'm calling a pre created report that is a simple ADOQuery from Delphi and in the pre -created report I don't set the number of rows in the master data band I get an EOF error (EOF OR BOF is true or current record has been deleted). And then the report loads just fine. However if i set the number of for less than or equal to the row count of the master data then I don't get that error. Is it required to know the number of master records when firing an ado query in a report called from delphi? here is the code i am using to call the report:

...

var Connection1 : tfrxAdoDatabase; //connection variable
    Query1 : tfrxADOQuery;
 ...



with tfrxReport.create(self) do
  try
      //Load Report
      LoadFromFile(ReportName);
      //load connection properties
      Connection1 := FindObject('Connection1') as tfrxAdoDatabase;
      //define connection username and password
      Connection1.setlogin('sysdba','BLAHBLAH');
      // prepare and show report
      if Preparereport then
      ShowPreparedReport;
    finally
      end;

I'm brand new using fast reports(this week is the first time i've used it. Im really struggling so any help would be greatly appreciated)


Solution

  • Ken was right, its an ADO error, the problem was the way the frxadocomponent set interacted with delphi. Theres an update for ado components for Delphi out there, but because Delphi 5 is no longer supported it was a pain to find. I did find it though here: http://alexandrecmachado.blogspot.com/2009/07/delph-5-update-packs.html Thanks for your help Ken