0

Well, I have an application ERP constructs in Delphi with ZEOS. Database is SQL SERVER. When happens some error, it doesn't return correct message, independent error, always return: -1 record(is) updated. Only one record should have been updated instead of correct error For example: I know problem is that I'm trying to delete a customer that has Foreign Key with another table. But in my software, when I try to delete this customer, I receive the message "-1 record(s) updated. Only one record should have been updated" instead of "The DELETE statement conflicted with the REFERENCE constraint "foreign key name". The conflict occurred in database "database name", table "table name", column 'column name'."

But, I guess it doesn't a problem in my Delphi. Because, if I use the same application, but with the database of another customer, it works!

Has anyone any solution?

For now, thanks.

Dirceu Vieira.

  • admittedly I havent used zeoslib in a very long time. to best of my knowledge even back then it was hugely outdated. Depending on your delphi version I'd suggest you move off it, in favor of firedac which comes with delphi. Other then that, I always avoided using foreign keys with zeoslib. you might want to consider that too. – Tuncay Göncüoğlu Jul 04 '17 at 13:25
  • Review the use of transactions. – Victoria Jul 04 '17 at 13:36
  • Maybe one db has cascading deletes for the FK the other one doesn't? – FredS Jul 04 '17 at 16:34
  • Thanks for answering me, but just to remember: I know what's the problem in the database. My question is: why don't show me the correct error "The DELETE statement conflicted with the REFERENCE constraint "foreign key name" and show me always "-1 record(s) updated. Only one record should have been updated"? – Dirceu Vieira Jul 04 '17 at 18:14

0 Answers0