Can't perform operation on active transaction
Posted: Tue 17 Jan 2017 08:16
Hi,
I am starting with my porting from FIBPlus to IBDac.
I am getting the following error when executing the following block of code, which is executed when the user hit's the save button on the screen, once he has made changes to the record being displayed.
The error occurs on the line.
I have the following components on the form:
TIBCQuery
TIBCDataSource
TIBCTransaction
When entering the screen the following code is executed to position the record that is being edited.
The correct record is being displayed on screen, and the user is allowed to edit it.
I am obviously missing something silly over here, could you please point me in the right direction.
Regards
Marius
I am starting with my porting from FIBPlus to IBDac.
I am getting the following error when executing the following block of code, which is executed when the user hit's the save button on the screen, once he has made changes to the record being displayed.
Code: Select all
procedure TfrmEstimator.btnSaveClick(Sender: TObject);
begin
qryEstimatorMaintenance.Transaction.StartTransaction;
try
qryEstimatorMaintenance.Post;
qryEstimatorMaintenance.Transaction.Commit;
except
on E: Exception do
begin
qryEstimatorMaintenance.Transaction.Rollback;
ShowMessage('Error: ' + E.Message);
end;
end;
Close;
end;
The error occurs on the
Code: Select all
qryEstimatorMaintenance.Transaction.StartTransaction;
I have the following components on the form:
TIBCQuery
TIBCDataSource
TIBCTransaction
When entering the screen the following code is executed to position the record that is being edited.
Code: Select all
procedure TfrmEstimator.FormShow(Sender: TObject);
begin
if fFormAction='Edit' then
begin
frmEstimator.Caption := 'Edit Estimator';
qryEstimatorMaintenance.ParamByName('IRN').AsInteger := fKey;
qryEstimatorMaintenance.Open;
qryEstimatorMaintenance.Edit;
end
else
begin
end;
end;
I am obviously missing something silly over here, could you please point me in the right direction.
Regards
Marius