SDAC Dataset.Post
Posted: Tue 05 Feb 2008 07:30
Why is it that with the SDAC TMSQuery component, you need to use post instead of UpdateRecord to commit the changes to the dataset while in edit mode? The code below works fine, but thats when the post method is used on the dsEdit mode.
The following doesn't work, and as far as I know, thats how it used to work with TADOQuery:
Code: Select all
procedure TMA_Data.Commint_Dataset(var ADataset: TMSQuery);
begin
//Determine if this is insert of edit
if ADataset.State in [dsInsert] then //ADD
begin
ADataset.Post;
end
else //Edit
begin
ADataset.Post;
end;
end;
Code: Select all
procedure TMA_Data.Commint_Dataset(var ADataset: TMSQuery);
begin
//Determine if this is insert of edit
if ADataset.State in [dsInsert] then //ADD
begin
ADataset.Post;
end
else //Edit
begin
ADataset.UpdateRecord;
end;
end;