Hi friends,
Relative newbie here.
I am using Lazarus 1.6 r51630 FPC 3.0.0 i386-win32
I have struggled for hours with getting data from DBEdits on a form to commit to the database (Firebird 2.5). I've got it working, so this is more a question of 'Why is it working like this', than how to get it to work. :-)
This is the piece of code where I commit the transaction.
What I don't understand is; if I leave the if statement to check if the transaction is active, the commit doesn't happen. If I comment it out as below, it works fine (the edited data gets saved to the database).
How the can the COMMIT work if there is no active transaction?
procedure TJob_Card_Details.Close_ButtonClick(Sender: TObject);
begin
//If jms_main_form.JMS_Transaction.Active then
//begin
Job_Enquiry_List_Form.Enquiry_List_JobDesc_Dataset.ApplyUpdates;
jms_main_form.JMS_Transaction.Commit;
Job_Card_Details.Close;
//end;
Job_Enquiry_List_Form.Show;
end;