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

BDE Replacement

edited October 2006 in Datapipelines
Hello,

I am using Delphi 6 and Report Builder 7.02. I'm currently writing a small
ReportBuilder viewer app and I would like to move away from using BDE as we
have in the past. The problem with switching to ADO is that, according to
this thread (), I'll have to edit every report template. That is just not
feasible because we have a large customer base with many existing reports.
What about using a third party BDE replacement? Would this allow us to get
around having to edit all our report templates?

Thanks,

Glenn Thimmes

Comments

  • edited October 2006
    Hi Glenn,

    If you are not using the actual BDE classes, you will need to convert your
    templates to some extent to get them working with another connection suite.
    As it turns out, we have had many customers in the past that have done this
    successfully with little extra development. Take a look at the article
    below on how to manually convert from BDE to ADO. The same would apply for
    any other type of connection. Also, if you have numerous templates saved on
    a DB somewhere, you can use the following technique to access that template
    text on the fly.

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

    -------------------------------------------------
    Tech Tip: Convert BDE Template Dataviews To ADO
    -------------------------------------------------

    Currently when DADE is used to create dataviews, the DatabaseName is stored
    as part of the query definition. (This is consistent with Delphi's approach
    to specifying a database connection for a Query object).

    When you created the reports originally, the daDBBDE.pas BDE DADE plugin was
    used. Now you want to use ADO. You've already changed the
    Designer.Datasettings but this had no effect on the old reports. They still
    try to use the BDE connection. Changing the Designer.DAtaSettings only works
    for new dataviews that are created, because the new query dataviews are
    using the daADO.pas ADO DADE plugin.

    In order to convert the templates from BDE to ADO, at the minimum you have
    to change the database name and the DADE plugin class names that are stored
    in the templates. When a BDE dataview is created, its class type is a
    TdaBDEQueryDataview. When an ADO dataview is created, its class type is
    TdaADOQueryDataview. These class types are stored in the template. These
    have to be changed before the template is loaded into a report.

    First, compare a BDE report template to an ADO report template which both
    connect to the same database table. Save a BDE and an ADO based report
    template to separate ASCII text files. Now compare the dataview definitions.
    Change the TdaBDEQueryDataview class name to TdaADOQueryDataview in the BDE
    template. Change the BDE alias to your ADOConnection object. Then compare
    the table name and field names of the BDE template to the ADO template and
    change them accordingly, removing the .db extension on the table name is
    necessary. Now load the converted BDE template in your ADO end user
    application.

    The first step is to make a backup of all your templates before continuing
    with a programatic approach. You can convert the templates programatically
    by loading the ASCII template files to a TStringList object. Then loop
    through the lines of the list and change the text programatically. You can
    loop through the files in a directory using ppFileUtils.pas calling the
    GetFileNamesForDirectory procedure to load the file names.

    If you have binary report templates, you'll also be able to convert these
    with an extra couple of steps. You can load the binary template file into
    ASCII format, modify it, and then save it back to binary as shown in the
    example link below. Keep in mind the conversion is performed without loading
    the report template into a TppReport.

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


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.