tobenschain 0 Posted October 19, 2022 (edited) I am unable to delete a record. I get '[FireDAC][Phys][FB]-312. Exact update affected [0] rows, while [1] was requested'. This is my code using TFDTable BudSys_DB.Active := true; BudSys_DB.RecNo := recnum; BudSys_DB.Delete; This gives the same error if BudSys_DB.Locate('KEY', sysp^.key, []) then begin BudSys_DB.Delete; del_sys := true; end; Edited October 20, 2022 by tobenschain Share this post Link to post
ertank 27 Posted October 21, 2022 (edited) I am not using FireDAC, but here is a similar question from a google search. https://stackoverflow.com/questions/24614480/delphi-xe6-firedac-master-detail-error BTW, you should provide more details as to your specific case. Reading above link, it is related to Master-Detail links. Edited October 21, 2022 by ertank Share this post Link to post
Serge_G 87 Posted October 22, 2022 (edited) On 10/19/2022 at 10:50 AM, tobenschain said: BudSys_DB.RecNo := recnum; Really ! I don't think this use of recnum is serious. Why don't you use something like if FDConnection.ExecSQL('DELETE FROM mytable where Key=:K',[sysp^.key ])>0 then showmessage('record(s) deleted'); Even if I am not sure of this sysp^.key have the good value 😲 expect yes, but this should be tested by debug Edited October 22, 2022 by Serge_G 1 Share this post Link to post