Board index » delphi » Problems with Master/Detail, D3 3.02 and SQL 6.5

Problems with Master/Detail, D3 3.02 and SQL 6.5

Hi!

Could anyone tell me how to fix the following problem:
I'm using SQL 6.5 and Delphi 3.02 / BDE 4.51
I have a TTable1 as master and TTable2 as Detail both with Cached updates =
true.
Both use Identity fields as primary keys.
I insert the Master record and works fine.
When I insert the first child in TTable2 to the Master record in TTable1 and
ApplyUpdates it works fine.
When I insert the second child and apply updates I get the following error:
"Multiple records found, but only one was expected"
Why do I get this error?
How can I fix it?

--

Sincerely Yours,
Robert Kriger :-)

 

Re:Problems with Master/Detail, D3 3.02 and SQL 6.5


I use tquery instead of ttable. For master- detail i have two querys. One access
to
master and the other access to detail. The problem that you have is when you
apply updates. The server looks for the records that must update and if you dont
have
a record count for detail, server find some records where it wants find one.

In detail

ORDER
NUMBER OF LINE.
ITEM

The number of line is the problem.

I solve this at this manner:

When insert a new record look for the last record , view the LINE and add 1.
replace in the new record the field NUMBER of LINE with the new value.

Sorry for my bad english.

Juan Antonio.
Spain.

Robert Kriger escribi:

Quote
> Hi!

> Could anyone tell me how to fix the following problem:
> I'm using SQL 6.5 and Delphi 3.02 / BDE 4.51
> I have a TTable1 as master and TTable2 as Detail both with Cached updates =
> true.
> Both use Identity fields as primary keys.
> I insert the Master record and works fine.
> When I insert the first child in TTable2 to the Master record in TTable1 and
> ApplyUpdates it works fine.
> When I insert the second child and apply updates I get the following error:
> "Multiple records found, but only one was expected"
> Why do I get this error?
> How can I fix it?

> --

> Sincerely Yours,
> Robert Kriger :-)

Other Threads