views:

352

answers:

1

I have one TClientDataSet with several Fields and I'm getting this exception, I'm sure that I forgot to set one field value, but the question is, which Field?

Is there some way to find out quickly which field is raising this exception?

EDIT

I solved the problem, I was connecting the TClientDataSet to the wrong provider, which had a required field on the server but didn't have this field on the client.

But it still doesn't invalidate my question, I lost a lot of time to figure it out, and if I had some way to know which server side required field was raising this error it would be very quick to realise what was my mistake.

EDIT 2

Related QCs:

#5557 - Solved as "As Designed".

#54380 - Open

+4  A: 

When the debugger notifies you of the exception, look at the call stack. Navigate to the routine that is iterating over the list of fields, and inspect the loop-control variable at that point to find out how far through the field list your program got before raising an exception.

If the loop-control variable isn't accurate, then set a breakpoint in that routine and re-run your program. Step through until you get the exception again.

Another option is to look at all the fields and see for yourself which one lacks a value.

Rob Kennedy
The problem is that I can't debug it, it is raised by and stdcall on TClientDataSet's InternalPost, it passes the validation of TDataSet's InternalPost method.
Fabio Gomes
So, are you saying you can't reproduce the problem on your own computer? If the problem happens on your computer, then you can debug it.
Rob Kennedy
No, what I'm saying is: it is raised in line 2861 in DBClient.pas, which has this code: Check(FDSCursor.InsertRecord(ActiveBuffer)); the funcion InsertRecord is: function InsertRecord( { Insert new record } pRecBuf : Pointer ): DBResult; stdcall;And if I'm not mistaken, is from midas, so, how do I debug it?
Fabio Gomes