SDAC Dataset.Post

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FaNIX
Posts: 6
Joined: Sat 19 Jan 2008 13:22
Location: pretoria

SDAC Dataset.Post

Post by FaNIX » 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.

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;

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 05 Feb 2008 15:34

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.

Post Reply