Hello,
is the a property, where I can get the state I have hade before post the dataset? In my example I should make a refresh, if the state was insert. Of course I can make my own variable, but if there is something in UniDac it woukld be fine.
best regards
Gerd
State before post
-
norwegen60
- Posts: 19
- Joined: Wed 15 Dec 2010 13:12
Yes, I know. But I want to know the status I have had before Post like
Refresh should only be done, if there was an Insert before.
I can do it like
But maybe there is a Property in UniDac I didn´t found until yet
Code: Select all
UniQuery1.post
procedure TForm1.UniQuery1AfterPost(DataSet: TDataSet);
begin
if UniQuery1.BeforePost = dsInsert then
UniQuery2.refresh;
end;I can do it like
Code: Select all
UniQuery1.post
procedure TForm1.UniQuery1BeforePost(DataSet: TDataSet);
begin
stUQ1 := UniQuery1.state;
end;
procedure TForm1.UniQuery1AfterPost(DataSet: TDataSet);
begin
if stUQ1 = dsInsert then
UniQuery2.refresh;
stUQ1 := UniQuery1.state;
end;Hello,
To refresh DataSet only after insert, you can use the RefreshOptions property like
UniQuery.RefreshOptions:= [roAfterInsert];
or use the onAfterUpdateExecute event like
procedure TForm1.UniQueryAfterUpdateExecute(Sender: TDataSet;
StatementTypes: TStatementTypes; Params: TDAParams);
begin
if stInsert in StatementTypes then
UniQuery.Refresh;
To refresh DataSet only after insert, you can use the RefreshOptions property like
UniQuery.RefreshOptions:= [roAfterInsert];
or use the onAfterUpdateExecute event like
procedure TForm1.UniQueryAfterUpdateExecute(Sender: TDataSet;
StatementTypes: TStatementTypes; Params: TDAParams);
begin
if stInsert in StatementTypes then
UniQuery.Refresh;