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

DB Views support ...

edited October 2003 in DADE
Does DADE application support views. I have some serious views (that
joins several tables) that make life easy to some customers. How can I
use this views?

Thanks a lot in advance

Comments

  • edited October 2003
    Hi Luis,

    Table Views are not supported in the currently release. However, we have had
    a few customers modified the DADE plug-ins for various database, to add
    support for view. The TdaSession.GetTableNames method is the responsible for
    returning the list of available tables.

    Another customer using RB and IBExpress just today has sent the following
    proposed code modification to support Interbase views. Try using this
    code....


    File daIBExpress.pas

    {---------------------------------------------------------------------------
    }
    { TdaIBXSession.GetTableNames }

    procedure TdaIBXSession.GetTableNames(const
    aDatabaseName: String; aList: TStrings);
    var
    lDatabase: TIBDatabase;
    lTable: TIBTable;

    begin
    {get the database}
    lDatabase := daGetIBXDatabaseForName(aDatabaseName);

    lTable := TIBTable.Create(nil);
    lTable.Database := lDatabase;

    {this is a new line, not Digital Metaphors default,
    to allow You to make a report based on a View too,
    rather than just using Tables}
    lTable.TableTypes := [ttView];

    {connection must be active to get table names}
    if not lDatabase.Connected then
    lDatabase.Connected := True;

    {get list of table names from a table object}
    if lDatabase.Connected then
    aList.Assign(lTable.TableNames);

    lTable.Free;

    end; {procedure, GetTableNames}

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    Ok, I'll try it!

    I only have a few questions. I'm using MSSQL Server, do I need to make a
    copy of SQL Server DADE plugin in my project?, if so, what is the name
    of the file? and finally, what else do I need in oprder to compile this
    changes into my project?

    Thanks a lot in advance
    Luis Ximénez



  • edited October 2003
    Hi Luis,

    Yes, you will need to make a copy of the DADE plugin for SQL Server. You
    can name it anything you like as long as you register it at the bottom of
    the .pas file in the initialization section. Then you can simply re-build
    your application and it should work.

    --
    Best Regards,

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