Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: TADQuery Master/Detail
TADQuery Master/Detail
Posted: 2007/06/14 08:32
 
Is there a property (or connection param) to let AnyDAC insert automatically the 'Master' fields when i have a Master/Detail relationship described throu queries ?

Hmmmm... i'll try to be clearer:

i have q1: TADQuery
SQL = select * from t1

and q2: TADQuery
SQL = select * from t2 where IDt1=:ID
wirth DataSource=<The DS linked to q1>

when i insert a new record in q2 both BDE and ADO (dbGO) automatically set the IDt1 to the ID value in q1...

Obviously is not all that hard to write a 'AfterInsert' event handler that does this operation, but i have hundreds of tables that relates on this automatism, and so it could be a little long to do it manually...

TIA
Roby
Re:TADQuery Master/Detail
Posted: 2007/06/22 03:17
 
Hello

1) BDE, ADO and AnyDAC components will fill detail fields linked to a master, if detail fields have the same names as their master counterparts. So, if detail query will be "select * from t2 where ID=:ID", then it will work.
2) We have not planned the feature described by you for v 2.0. But I have added it to feature request list.

Regards,
Dmitry