Report crashing with OLE DB error

edited March 2019 in RAP
Hi,

We have a report that is used on multiple sites but only on one site does it crash from time to time. Can not pin it down to any user or PC/location.

The error code is: OLE DB error occurred. Code 80040E00h.

It would appear that the report is loosing connection to the data source (MS SQL) but we have no way of proving this or providing a work around to prevent this.

Does anyone have any suggestions to resolve this type of intermittent error please?

Kind regards,

Bruce

Comments

  • Hi Bruce,

    For future reference, please let us know which version of Delphi you are using and which connectivity you are using to access your DB (i.e. FireDAC, ADO, etc.).

    From researching this error online, it appears it may be caused by a threading issue. Starting with version 14, ReportBuilder began generating pages in a background thread in order to allow for continuous scrolling while still giving the user the ability to navigate. The fact that the pages are being generated in this background thread can cause issues if the same resources the Report is using are also being used by other components in the main thread. Below are some suggestions.

    1. Try setting the PreviewFormSettings.SinglePageOnly property to True and re-test your app. This will disable continuous scrolling but remove any threading from the preview.

    2. Generally issues are caused by the report and another data-aware component (DBGrid, etc.) are accessing the same dataset. It is recommended that you create separate datasets for the report to avoid this conflict.

    3. If this is not possible, you can try calling DisableControls for the dataset connected to the report before printing and see if that helps the issue.
    myDataSet.DisableControls;

    try
    myReport.Print;

    finally
    myDataSet.EnableControls;

    end;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Many thanks for the prompt reply. We are using the current version of Delphi and RB with UNIDAC latest version.

    I will work through your suggestions and report back soon.

    Best regards,

    Bruce
  • Option 1 seems to of fixed the problem! Many thanks again.
Sign In or Register to comment.