> I encountered the same problem.
> I think the problem is that after the master table is posted, the auto inc
> field value is not got by delphi/or ADO, in my case, the local copy of
auto
> inc field is always 0. And the local copy of the master record is
different
> with real record in db. Then, when a detail record should post, if you
just
> has a record with 0 CONT_ID, every thing will be OK except the detail
record
> is not in its right position, otherwise, it compliant that a record with
> same foreign key should be exists.
> I just close and reopen the master table and every thing will be right. I
do
> not know how to do it better.
> Liwen.
> Clment Doss <cd...@dhs.com.br> wrote in message
> news:3A4BA20D.116D1897@dhs.com.br...
> > Hi,
> > I am using ADO to access a SQL server 7 database.
> > The master has a Counter field as primary key (CONT_ID).
> > The detail has a compound primary key : (CONT_ID + IDAD_ID)
> > The user must give me the value for IDAD_ID.
> > I made all the links between two TADODatasets.
> > The detail table is edited/display using a grid.
> > While testing the program under th Delphi IDE I get an exception.
> > If I try to insert a record "An Unknown error has occured"
> > If I moves through the columns, same error.
> > But when I post, the record is commited and fine. And
> > the master/detail relation is honored.
> > Outside the Delphi IDE (or turning off the exceptions) everything seems
> fine.
> > I dont know if I can deliver an application with such behaviour...
> > Is there anything I can do to avoid this? What am I missing?
> > Best regards,
> > Clment