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

Access Denied on second run of report

edited August 2005 in General
Hi. I am running a report in V7.04 with Delphi 5 and DBISAM 4. The report
I am running uses a query that is defined on the "DATA" tab of the report.

The first run of the report works perfectly but seems to tie up the database
file and I receive an "Access Denied" error when I attempt to modify the
table after the report is run. This particular table (RESULTS) is used in a
subreport in the report I am running.

AFTER the report runs, I have been using the "LoadReport" method of the
ReportExplorer component to load a different report and that resolves the
"Access Denied" error. But, I'm sure theres a better way to "unload" the
report/subreport so it no longer ties up the database? As per the
newsgroups, I have tried the Report.Reset method and
Report.DataPipeline.Close, but I am unsure as to whether that is just
freeing up the main dataview and not the sub data views????

Any insight on how to "Close" or "unload" the report correctly would be
appreciated. Thank you.

Brian Kennedy

Comments

  • edited August 2005

    To clear out the report try this:

    Report.Template.New; // clear the layout
    Report.FreeModules; // free the data associated with the report

    If you just wanted to close the subreport datapipeline you can try this

    Report.DataPipeline.Close;
    Subreport.Report.DataPipeline.Close;


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



    Best regards,

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