Thanks Clauslack,
We are using FIBDataSet to display the entire data and to allow scrolling.
The insert and update are done with a separate FIBQuery.
I tried setting autocommit and autostarttransaction but this did not change the behaviour.
The update does work, but we have to close the app and restart it to see the new data.
The code below shows how we disengaged the DBGrid.DataSource and added a MessageDlg.
This seems to successfully post, commit and then allow display the new data - but this is clearly not the correct way to do it... Even adding a long sleep without the messagedlg seems to work. Is this a glitch of the DBGrid?
Has anyone used FIBL to update and view the new data immediately?
DBGrid1.DataSource := nil;
if messagedlg('continue',mtconfirmation,[mbok],0) = mrok then
begin
sleep(800);
FIBDataSet1.Active := False;
FIBTransaction1.Active := False;
FIBTransaction1.Active := True;
FIBDataSet1.Active := True;
FIBDataSet1.First;
FIBDataSet1.Last;
FIBDataSet1.First;
FIBDataSet1.Locate('idnum',currentidnum,[]);
sleep(800);
end;
DBGrid1.DataSource := DataSource1;
-----------------------------
We are also trying another method from the FIBL documentation that comes with the source.
This method uses the same FIBDataSet for select, update and insert. This method seems to refresh the dataset without problems, but it does not update. Anyone have similar experience?
FIBDataSet1.QUpdate.Params.ByName['notes'].AsString := EditNoteComment1.text;
FIBDataSet1.QUpdate.ExecQuery;
FIBDataSet1.ApplyUpdates;
FIBDataSet1.QRefresh.Params.ByName['idnum'].asInteger := currentidnum;
FIBDataSet1.Refresh;
--------------------------