Skip to content

Commit ca238aa

Browse files
committed
enhance: rephrase warning message displayed when a grid edit/delete did not affect any row
Refs #2568
1 parent effb854 commit ca238aa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/dbconnection.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9585,7 +9585,7 @@ procedure TDBQuery.DeleteRow;
95859585
TempRowsAffected := Connection.RowsAffected;
95869586
Connection.ShowWarnings;
95879587
if TempRowsAffected = 0 then
9588-
raise EDbError.Create(FormatNumber(TempRowsAffected)+' rows deleted when that should have been 1.');
9588+
raise EDbError.Create(f_('The DELETE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row.', [FormatNumber(TempRowsAffected)]));
95899589
end;
95909590
if Assigned(FCurrentUpdateRow) then begin
95919591
FUpdateData.Remove(FCurrentUpdateRow);
@@ -9850,7 +9850,7 @@ function TDBQuery.SaveModifications: Boolean;
98509850
TempRowsAffected := Connection.RowsAffected;
98519851
Connection.ShowWarnings;
98529852
if TempRowsAffected = 0 then begin
9853-
raise EDbError.Create(FormatNumber(TempRowsAffected)+' rows updated when that should have been 1.');
9853+
raise EDbError.Create(f_('The UPDATE affected %s rows, but 1 was expected. On tables without a primary or unique key, HeidiSQL must match on all columns, so edits may not reliably target the intended row.', [FormatNumber(TempRowsAffected)]));
98549854
Result := False;
98559855
end;
98569856
end;

0 commit comments

Comments
 (0)