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

TdaMetaCache.GetFields: unable to find table in cache

edited December 2003 in Server
I have two report files each with two data queries and both reports work
in serveral databases, except for one database.
That database produces:
Server Error: Processing request for report Report Files\Usage\Corporate
Monthly Usage
Design Error: TdaMetaCache.GetFields: unable to find table
asambrhis in cache

Both reports are very similar in that they use the same tables with the
same link between dataviews. The asambrhis is in the second dataview in
both reports. The data dictionary is the same in all databases and
seeing previous post about cached data made it my first check, and the
problem occurs if the report is the run first or second. The report
will run in the designer, just not from the server. If it failed on all
database I would suspect the database name, but since it is just one
then I'm have a problem narrowing down where the problem lies.

Thanks,
David C. Allen

Comments

  • edited December 2003

    It might be that the Designer.DataSettings used to create that DataView were
    different than the DataSettings used to create the dataview that is working.
    The DataSettings are saved as part of the dataview definition.

    Check the Designer.DataSettings and then create a simple report that uses
    the same tables. See whether that works correctly.

    There must be a difference in your design environment and the server runtime
    environment.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2004
    I've saved the report while connect to the db that fails. Before saving
    the report ran and displayed data without any problems. All the report
    servers are the same program, just start with a different db according
    to command line params. The report works with all the other db's.
    How would you check the Designer.DataSettings on the server?
    I've been using the onReportLoad to set the db name. Is this the best
    approach?

    Dave


    procedure TdmReportTemplateVolume.SetSQLObject(aReport: TppReport; aSQL:
    TdaSQL);
    var
    lDataModule : TdaDataModule;
    lDataView : TdaDataView;
    Indx : Integer;
    begin
    // aSQL := nil;
    {get the datamodule}
    lDataModule := daGetDataModule(aReport);

    if (lDataModule <> nil) then
    begin
    for Indx := 0 to lDataModule.DataViewCount -1 do
    begin
    lDataView := lDataModule.DataViews[Indx];

    // set the database name to the module db
    if (lDataView <> nil) and (lDataView is TdaQueryDataView) then
    TdaQueryDataView(lDataModule.DataViews[Indx]).SQL.DatabaseName
    := Session1.Databases[0].DatabaseName;
    end;
    end;
    end;


  • edited January 2004

    Yes, using ReportTemplate.OnLoadEnd to check the database name property is a
    good approach.

    You can try tracing the RB source code in the DADE plug-in that you are
    using to see whether the proper database connection is being made.

    If you are using multiple database connections in a single server app, you
    may want to try clearing the RB meta data manager in the Report.OnLoadEnd
    event as well. The RB meta data manager caches information about the
    database schema: tables, fields, etc. for the connection being used.

    uses
    daMetaDataManager;

    begin

    gMetaDataManager.Clear;

    end;


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2004
    Nard,
    I've just discovered that the table in question is a synonym and is
    actually in another database, just in the one place. All other
    databases have the table.

    Is there anything to be done for this case?

    Dave


  • edited January 2004

    This is not really a server issue, but an RB Dade issue.

    ReportBuilder's Data Access Environment (DADE) is not designed to support
    connections to multiple databases. You might consider modifying the report
    to use external datasets and datapipelines.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

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