Hi
Hi,
I have a Delphi app ( Delphi XE10 Tokyo) with SQL Server and TFDQuery with cachedupdates=true. When I Call a save function and use transaction and FDQquery1.Applyupdates , after commiting data , and user calls again the save function in the statement FDQquery1.Applyupdates I get the exception 'SQL_NODATA'.
I would be obliged if someone could give me a solution.
Thank you
I have a Delphi app ( Delphi XE10 Tokyo) with SQL Server and TFDQuery with cachedupdates=true. When I Call a save function and use transaction and FDQquery1.Applyupdates , after commiting data , and user calls again the save function in the statement FDQquery1.Applyupdates I get the exception 'SQL_NODATA'.
I would be obliged if someone could give me a solution.
Thank you
Hi Nick , its been some time with Delphi , but you may have to check a property on your TFDQuery or Dataset to see if there is "pending" modifications and then allow a call to "save".
ReplyDelete( apology for my English , not my native language )
Hope i helped.
Sevastianos Vlachopoulos.
You can check for (ChangeCount > 0) before calling ApplyUpdates.
ReplyDeleteΣεβαστιανός Βλαχόπουλος
ReplyDeleteI did not define Primry key for the SQL SERVER table and that caused the problem.
Thank you very much for your help
Uwe Raabe
ReplyDeleteI did not define Primry key for the SQL SERVER table and that caused the problem.
Thank you very much for your help
You can always test if there are any pending updates calling method UpdatesPending. And also After calling applyupdates you must call commitupates. So this let know the query that there are no more pending updates. So if you call again Applyupdates you won't receive error.
ReplyDelete