0
votes

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)

1
The problem has nothing to do with FastReport; the error you're getting is an ADO error (your tfrxAdoDatabase). This off-site article might help.Ken White
tfrxAdoDatabase is a fast report component, the query its using does has rows and is coming from a view that is not having any of its tables modified in any way before calling. its like it just decides to break when it runs out of code.Tidmore
I know it is, but the exception is being raised by ADO (as I mentioned in my last comment) and not FastReport. It's an ADO exception.Ken White
alright, thanks, unfortunately the article wasnt much help, but i appreciate it.Tidmore

1 Answers

2
votes

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