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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.