The point is that to delete record TUniTable executes a query to a database. If your table doesn't have the Primary Key, this query will use all the fields:
Code: Select all
DELETE FROM dept
WHERE DEPTNO = :DEPTNO AND DNAME = :DNAME AND LOC = :LOC
So, if there are more than one record with the same field values, UniDAC will raise the "Refresh failed. Found N records" exception (unless the StrictUpdate option is set to False). To avoid this problem, your table should have the Primary Key. In this case, UniTable will execute the query using only the fields of the Primary Key:
Code: Select all
DELETE FROM dept
WHERE DEPTNO = :DEPTNO
In this case you can be sure that such query will delete only one record.
You can set the TUniTable.Debug property to True to display the statement that is being executed. It will help you to understand the behaviour of the TUniTable component. Note that you should add the UniDacVcl unit to the USES clause of any unit in your project to make the Debug property work.