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

"Cannot modify a read-only dataset" error

If the rbItem table is empty, when saving a new report I get the error "Cannot modify a read-only dataset".

I thought it was some problem in my code, but it also occurs with the ".\4.EndUser Databases\NexusDB" if I delete all records from tbItem table.

I'm using RB 19.02 with Delphi Tokyo 10.2.3 and NexusDB 4.50.05.

My code worked correctly until version 18 of RB.

Comments

  • edited October 2018
    Hi Samuel,

    This appears to be a change in NexusDB. The latest version(s) of NexusDB altered the way values can be compared to an unassigned (NULL) value which causes access issues when reading or manipulating the ItemUpdate query.

    To solve the issue, you can alter the ItemId parameter of the ItemUpdate query to have a default value and type so it is never returned as NULL. In my testing, an "Integer" value of 0 worked fine.

    I will update the NexusDB demo to reflect this change for the next release of ReportBuilder.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • I did what you said and this issue has been resolved but I can not change or run the created reports.

    When I try to change or run a report I get the error "Formato de matriz inválido" (Invalid array format).

    If I change default value for the parameter to "Unassigned" this error does not occur however I can not create reports if the table was empty.
  • Hi Samuel,

    Okay, let's go back to having an Unassigned parameter and alter the ItemUpdate SQL to handle the special case when there are no records in the dataset.

    if :ItemId is null then

    select ItemId, FolderId, ItemName, ItemSize, ItemType, Modified, Deleted, Template
    from rbItem;

    else

    select ItemId, FolderId, ItemName, ItemSize, ItemType, Modified, Deleted, Template
    from rbItem
    where ItemId = :ItemId;

    end if;
    In my testing this allowed me to create reports when the rbItems table was empty and alter existing reports without issues. Let me know if it works for your application.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,

    Your suggestion solved this issue.

    Thank you.
Sign In or Register to comment.