Clientdataset closing after opening

0

I've been using delphi xe6 for a few days now and I'm breaking my head with a problem. I have the trio here: SQLDataSet - > ClientDataSet - > DataSetProvider .

When I open my form, I call cdsPessoas.Open (ClientDataSet).

So far so good, it displays my records all right. But at the time I call cdsPessoas.Append , it returns me the error saying that the ClientDataSet is not active. The problem is that at no time do I close it, that is, I do not know why the heck he is closing alone.

I use these components within a data module along with two more ClientDataSets and SQLDataSets by doing the Master \ Detail . I've already tried to get the master \ detail, but that's not the problem, because the data is displayed correctly.

Does anyone have any idea what it can be?

    
asked by anonymous 10.06.2014 / 03:30

1 answer

3

Considering the information provided, I am not able to point out a direct response to the problem, so I will try to help otherwise, with an idea.

In situations like this what I do is compile the application with Debug DCUs and put an event handler, in this case, AfterClose of the Dataset in question. So when I try to use the breakpoint and CallStack p>

I usually find my code, an event handler I had forgotten or even a bug that is responsible for the case. Sometimes it is a normal behavior of the component that I did not understand well or the use of a property in the wrong way.

Anyway, with CallStack I can usually understand what is causing the strange behavior and solve the case.

Try it out!

    
10.06.2014 / 12:39