delphieventstadoquerytadotable

insert to a different table onNewRecord


got an ADOQuery that has OnNewRecord event.

on the procedure i try to add data automaticaly to another table. the data is a few rows that are needed and handled in clientDataSet in case of cancellation.

at the loc

OtherAdoQuery.insert;

I get error that ADOQuery failed to insert null into a non null field. I am in insert mode, however I NEVER ASKED DELPHI TO POST! i dont find why it posts.

Edit: could you help me find a hint on this problem?

some more clarification:

at

ADOQuery.onNewRecord();

begin

CliendDataSet.insert; //here goes to post for ADOQueryPost. where ClientDataSet was in Browse State

end;

Edit:

this bug does not make sense! look at the stack trace:

where myFunc does cause NewRecord with the Insert.


Solution

  • the answer was from a connection between the tables.

    the ADOQuery.dataSource was set the DataSet of the ClientDataSet.

    this mad so much damage, and no hint by the delphi.