Home End User

Get database connection

edited February 2009 in End User
Hi there!

In a custom report explorer based on your tutorial i have added a couple of
menues. Through this menues i need to get the current databaseconnection to
do a update on a custom field in rb_item. I use TADOConnection to a
mssql-server in delphi 2007 and RB 11.02.

Is there a way i can get this connection or the connectionstring?

Best regards,
Terje

Comments

  • edited February 2009



    From the explorer form, you can use the GetReportExplorer function to access
    the ReportExplorer component.

    The ReportExplorer.Owner is the Form that contiains all of the components
    you see at Delphi design-time.

    Therefore, you can use Form.GetComponent('ComponentName') to access to any
    component.

    Example:

    lOwner := GetReportExplorer.Owner;

    lADOConnection := TADOConnection(lOwner.FindComponent('myADOConnection');


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.