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

Switching Database - Interbase

edited April 2003 in DADE
Hi all,

Have read previous post on Switching Databases but nothing there seem to
help (or maybe me just cant find it)

I have used the end user reporting demo to create the reports. In my main
app i only have the report and table component linked to a database
connection which i want to change to reflect the different databases.

Have tried to have the database connection on the form but that has not
worked.

Any help would not go amiss here

Dean

PS RB6/D6/Interbase 7 running on win xp. Oh and any news on a kylix
version of report builder.

Comments

  • edited April 2003
    The database name is saved down inside the template inside each dataview.
    This way when the dataview is streamed up, it can find its connection.
    You'll have to edit the internal dataview definitions to work with the new
    connection. This can be done in code by loading a binary template from the
    database and convert it to ascii text. This technique doesn't require you to
    load a template into a TppReport. Then parse the ascii text to change the
    database names. Then save the template back down as a BLOB in the database.
    Now you can load the template into the report designer which has the new
    database settings and it should use the new connection to get data. Here is
    an example of loading a binary template as ascii text and saving it back
    down.

    http://www.digital-metaphors.com/tips/ConvertBinaryTemplateToASCII.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    Thanks Jim,

    Fixing my problem was so simple when you look back at it.

    I had a TIBDatabase Component in my main Datamodule. plus i put another one
    in the Datamodule that housed the TReport Component. (Just like you said.
    from one of your postings). But just didnt work and i could find out why
    tried everything.

    So! (a bit more infomation) my TIBDatabase components ( one in the
    datamodule and the one in the report module) were called the same i.e.
    DBConnect and the End user report (from the demo sample) had a TIBDatabase
    Connection called DBConnect.. For some strange reason the report componenet
    picked the Main Datamodule Connection and not the Report connect even though
    the report componetn and the desired dbConnect were in the same module. So
    renaming my main TIBDatabase component to a new name fixed the problem

    Thanks for your help

    Dean


This discussion has been closed.