ADO connectionstring

Hi,

I'd like to know how to set the connectionstring of a TfrxReport in runtime. I'm using FastReport 4.8.34 and Delphi 5.

Best regards,

Pifou

Comments

  • edited November 2009
    Self-replying as I found some workaround, but my solution seems quite dirty :s :
    var
      DB : TfrxADODatabase;
    begin
      DB := TfrxADODatabase(frxReport.FindObject('ADODatabase1'));
      DB.Connected := false;
      DB.DatabaseName := MyConnectionString;
      DB.Connected := true;
    end;
    


    I wasnt able to avoid the automatic connection on report creation, and found no "frxReport.addObject" function.

    Also, this is not only dirty, as at the moment, I get a connection error when I process my impression. Seems the report is still trying to get something from the initial connection (i.e. the one embedded in the report), as I get a "invalid username or password" error when printing.
    That error doesn't prevent me from printing, and I should be able to catch it, but it's not very clean.

Leave a Comment