Home DADE

TdaMetaCache.Getfields

edited May 2003 in DADE
we have been successfully using Delphi 5 and RB 6.03 for quite a while and
developed a number of reports that use the Report Designer with DBISAM
v2.11. These reports do not use a data dictionary. We just reference a
database.

We have recently upgraded to Delphi 7, RB 7.02 and DBISAM v3.21. Now when
we try to execute the reports that worked fine under Delphi 5 etc. we get
"TdaMetaCache.Getfields unable to find table DTRVICTM.DAT (table varies
depending on the app) in Cache. The query will execute at design time but
if we try to view the fields in the Query Designer that is when we get the
error. Also we get the error when we try to execute the report at runtime.
I looked through the documentation but could not find a solution. Does
anyone have a fix to this problem? thanks, LL

Comments

  • edited May 2003
    Try disconnecting the data dictionary and make sure
    Datasettings.UseDataDictionary is set to false. If that doesn't fix it, then
    it sounds like your data settings changed. Are you changing the datasettings
    on the designer component at runtime? That could cause this error. What can
    happen is the tables are retrieved from the database and placed in the
    cache. The cache can get out of sync if you change the datasettings property
    at runtime after it has tried to get the available table names and considers
    itself populated. So, you'll have to reset the meta data cache if that is
    the case. Try calling:

    uses
    daMetaDataManager;
    ...
    gMetaDataManager.Clear;



    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    That did not do it. There is no reference in the program to a data
    dictionary. The only component on the form is the TppReport. Also, where
    do I find the dataSettings property. It is not part of the TppReport
    component. thanks, LL


  • edited May 2003
    Can you create a new report and a new version of the same dataview? Make
    sure you can do this in order to test that you have the datasettings
    correctly configured- it may be that the database name changed in your
    datasettings? Did you change the database name the datasettings you used
    previously? The data settings are stored in the dataview's definition in
    the report template. When the dataview is streamed up, it tries to find the
    database connection object that it was originally created with. Do you have
    two database connections- one old and one new?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    I set up the old machine with Delphi 5 next to the new one with Delphi 7.
    When I bring up the OLD report and view the Metadata Cache (CTRL+Click) I
    see fields associated with the tables. With the new report there are no
    fields displayed when I view the Metadata Cache. Obviously the new version
    of RB operates differently from the old. How can I populate the fields in
    the Metdata cache? I don't want to have to go back and recreate all of
    these reports. thanks, LL

  • edited May 2003
    You can access the meta data manager and ask it to get the tables. Here is
    the call from daSQL.pas which does this:

    gMetaDataManager.GetTables(FSession, FDataDictionary, FDatabaseName,
    lTables);

    The session is the TdaDBISAMSession created by your DADE plugin
    daDBISAM.pas. You can extract the TdaSQL object from the data module in the
    report as shown in this example:
    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip

    Then you can ask the TdaSQL object for its Session, DataDictionary and
    DatabaseName properties so you can pass these in the call above.

    Look in daMetaDataManager.pas for more info on the meta data manager class.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.