Hi,
I'm working on a small module in my application, witch enables the user to edit SQL-Statements (only SELECT).
When TIBCQuery.open is called, the resulting list is displayed in a TDBGrid.
The problem is, that the user can use INSERT or UPDATE-Statements to manipulate the Data.
After the call of an INSERT-Statement (with open), an exception is raised (no Data in the Database).
But with the next Execute-Statement (witch I call in the on-close of the Form), the failed INSERT-Statements also gets executed (and the Data inserted into the Database).
EDIT: I'm workin with Delphi 2007 and Version 6.90.0.60
INSERT can be executed with open?
Hmmm, found something:
This fixes my problem, but is there an option for this?
Code: Select all
try
query.Open;
except
on e : Exception do
begin
query.Transaction.Rollback;
MessageDLG(e.Message,mtError,[mbOK],0);
end;
end;