Cannot modify a read-only dataset

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swright
Posts: 32
Joined: Wed 23 Dec 2009 12:19

Cannot modify a read-only dataset

Post by swright » Wed 19 Jan 2022 15:31

Delphi 7 SDAC issue after update

Updated from 9.3.2 to 10.0.2 and keep getting "Cannot modify a read-only dataset" when calling MSTable.Delete.

Reverted to 10.0.1 and still get the same issue.

Reverted to 9.3.2 and all working ok again.

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Cannot modify a read-only dataset

Post by Stellar » Thu 03 Feb 2022 10:36

Hi,

Unfortunately, we couldn't reproduce the issue. To investigate this behavior of SDAC, please compose a small sample demonstrating the issue and send it to us, including database objects creating scripts.
You can send the sample using the contact form at our site: devart.com/company/contactform.html

Best regards,
Sergey

swright
Posts: 32
Joined: Wed 23 Dec 2009 12:19

Re: Cannot modify a read-only dataset

Post by swright » Thu 17 Feb 2022 10:41

I have taken a look and managed to create the problem with this test.

tblTest.FilterSQL := AnsiQuotedStr('Agent Code','"')+'='+AnsiQuotedStr('0TESTA12','''');
tblTest.Open;
MSConnection1.StartTransaction;
try
for i := 0 to tblTest.Fields.Count-1 do
tblTest.Fields.ReadOnly := True;
tblTest.Delete;
finally
MSConnection1.Rollback;
end;

The above code deletes the row in 9.3.2 (then rolls back). Fails with "Cannot Modify a read-only dataset" in 10.0.2

The reason for the fields being set read only is that the editor for the row is shown "read only" to the end user so they can see what they are deleting before clicking delete to remove the row.

I made another test using TTable and that deletes the row like 9.3.2.

Regards

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Cannot modify a read-only dataset

Post by Stellar » Wed 09 Mar 2022 12:54

Hi,

Thank you for your reply.
We've reproduced the issue and started to investigate possible causes of the described behavior.
We will let you know the results as soon as we get them.

Best regards,
Sergey

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Cannot modify a read-only dataset

Post by Stellar » Thu 01 Sep 2022 07:45

Hi,

Please be informed, that the "Cannot modify a read-only dataset" issue when deleting an entry has been fixed in the latest SDAC 10.1.1.

Kindly check if the issue still persists in the latest version of SDAC.
In order to do this, you may download the trial version of SDAC 10.1.1 from our website.

Best regards,
Sergey

Post Reply