Page 1 of 1

SDAC Dataset.Post

Posted: Tue 05 Feb 2008 07:30
by FaNIX
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.

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;
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.UpdateRecord;
  end;
end;

Posted: Tue 05 Feb 2008 15:34
by Antaeus
Could you send us a complete small sample at sdac*crlab*com to demonstrate this difference in behaviour?

Also supply the following information:
- script to create and fill table used in the sample;
- exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- exact version of your IDE;
- exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.