I've just updated from an older version of SDAC to 4.5.
We are now continually getting 'Cannot create new connection because in manual or distributed transaction mode' errors in code like that below:
Code: Select all
begin
if CustomerNotesGrid.RowCount>1 then begin
with DataResource do begin
MSConnection.StartTransaction;
try
with MSDeleteCustomerNotes do begin
ParamByName('URNToDelete').AsString:=SendingFrom.URNAssignedToOrder.Caption;
Execute;
end;
with MSCustomerNotes do begin
Active:=true;
for RowLoop:=3 to CustomerNotesGrid.RowCount-1 do begin
Append;
FieldByName('CustURN').AsString:=SendingFrom.URNAssignedToOrder.Caption;
......
end{for}
MSConnection.Commit;
ShowMessage('Customer notes saved successfully');
except
on E:Exception do begin
ShowMessage('Customer notes could not be saved ('+E.Message+'), please retry.');
MSConnection.Rollback;
raise;
end
end;
MSConnection.ApplyUpdates;
end;
end{if};
Close
end;
The odd thing is this never happened in the previous version 4.35 and has only started since I updated to 4.5. Is it easy to return to version 4.35 if there is no solution to this problem because we really need the transactions to work?
Many thanks,
Trevor