The problem is you set mainQ.UsePrimaryKeyAsKey:=False;
The database components automatically create an insert, update and delete object with the correct SQL for your SELECT-statement (according to a unique ID of the record which is usually the primary key). But if you don't have a correct primary key how would it know WHAT record to change.
Normally an update-SQL is created like this:
UPDATE table_name
SET column1=value1,column2=value2,...
WHERE ID=:ID;
(where ID is your primary key)
In your case when
you set UsePrimaryKeyAsKey to false it is:
UPDATE table_name
SET column1=value1,column2=value2,...
In that case all records would be changed.
Therefore if you don't leave UsePrimaryKeyAsKey true the update-SQL
will be left empty and you would need to
set it yourself like this (in mainQ.UpdateSQL.Text):
UPDATE table_name
SET column1=value1,column2=value2,...
WHERE Somefield=:Somefield
(where somefield is some field which
can uniquely identify your record)
But i would advise you to use the primary key (which should be ID).
Why did you set the UsePrimaryKeyAsKey to false?
Edit: BTW. This behavior is also set by the Updatemode of mainQ.
You left it at upWhereKeyOnly which means the WHERE clause of updateSQL is created with only the primary key (and in that case you shouldn't set UsePrimaryKeyAsKey to false). You could also set it to upWhereAll. In that case the updateSQL would use all known fields to check for uniqueness. (But i would still advise using the primary key because that one is always unique)
See also
UpdateMode and
UsePrimaryKeyAsKey