delphidelphi-2010fibplus

Strange behaviour about "Dataset Not In Insert or Edit Mode..." Error


I am using Delphi 2010 with TFIBDataset components.

I am facing a very strange issue, I have two TFIBDataset components called DS1 and DS2.

When I am trying to post the data in DS1 as below:

DS1.Post;

I get the error saying that "Dataset Not In Insert or Edit Mode...".

I faced such errors related to the datasets whose data I am trying to post, but this completely new issue I am facing.

Even though I tried to make DS2 in edit mode as below:

DS2.Edit;
DS1.Post;

Then also I am getting the same error.

Any clue ?


Solution

  • I got the code working by writing below code:

    DS1.DisableContrils;
    DS1.Post;
    DS1.EnableContrils;