Ah, I now notice the Add in "UpdateSQL.Add (dgs);"
But that won't work. The UpdateSQL (and SQL.Text for ExecSQL) only accepts one statement.
You can't change two records with one statement.
You can execute them after each other and if one fails you could do a rollback.
I also wouldn't use the TQ_Divisies for this purpose but would use a separate TSQLQuery. (You could also use TSQLScript but I think it's overkill for this situation.)
var
dgs: string;
TempSql: TSQLQuery;
begin
TempSql := TSQLQuery.Create(nil);
try
TempSql.DataBase := TQ_Divisies.Database;
TempSql.Transaction := TQ_Divisies.Transaction;
// I take it Transaction of TempSql is the same as Form_Information.transRefereeDB
// otherwise you would need:
// TempSql.Transaction := Form_Information.transRefereeDB;
dgs := 'UPDATE tbl_Divisie SET Divisie_Volgorde = %d WHERE Divisie_ID = %d;';
// only one string because we're using format later on
TempSql.SQL.Text := format(dgs, [Volgorde_Vorige, ID_Huidige]);
TempSql.ExecSQL;
TempSql.SQL.Text := format(dgs, [Volgorde_Huidige, ID_Vorige]);
TempSql.ExecSQL;
if TempSql.Transaction.Active then
TSQLTransaction(TempSql.Transaction).CommitRetaining;
finally
TempSql.Free;
end;
end;