Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Linking user report to different database at run time

edited December 2006 in End User
I have user reports that need to access different databases at different
times.
i.e. during the summer they would access summer data base
during winter they would access winter database .....
The data in each database is the same structure

Is it possible to write one report that could access either database ...
with out user intervention.
In other words ... I would like to be able to assign the database( used by
the report) based on which database they are using at the time the report is
run.


--
Have a great day!

Walt Kersten
wkersten@wkersoft.com

Comments

  • edited December 2006
    Hi Walt,

    Yes, this should be possible. If both databases are structured the same (at
    least with the data that the report needs to access) you could for instance
    place two connection objects on your form, each connected to a separate
    database and toggle between the two of them based on the time of year.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    I really have five different databases ... all structured the same ... That
    I need to access ... 5 connection objects would not be practical.
    How does a report know which database to access and can I change this when
    the report is selected in the report explorer prior to opening the report
    designer and or running the report.
    Have a great day!

    Walt Kersten


    --
    Have a great day!

    Walt Kersten
    wkersten@wkersoft.com
  • edited December 2006

    Configure the Designer DataSettings to reference a database connection
    object that resides on the same form/datamodule as the report component. For
    example, if you are using ADO, you would use an ADOConnection object, let's
    call it "ADOConnection1". Then the queries that you create, will be saved
    with a reference to ADOConnection1. You can configure ADOConnection1 to use
    different connection strings that connect to the winter or summer database,
    etc.
    Same concept applies if you are using BDE, Interbase Express or any other
    data access component set.


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

    Best regards,

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