开发者

ADOTable.Locate in Master-Detail Relationship

开发者 https://www.devze.com 2023-04-03 06:41 出处:网络
I have a Master-Detail Relationship between two Tables , I Select a Record in Master Table and its Details shows in Detail Table , next i want to Locate in Detail Table Only in Details about Master Ta

I have a Master-Detail Relationship between two Tables , I Select a Record in Master Table and its Details shows in Detail Table , next i want to Locate in Detail Table Only in Details about Master Table`s Selected Record but when I use ADOTable.Locate(...) , it locates in all Records of Detail Table !

For Example I have this Tables :

Master :

ID | Name

11 | Mahmood

22 | Maseoud

....

Detail :

UID | Pet(!)

11 | Cat

22 | Dog

22 | Cat

I ha开发者_Go百科ve selected User "Mahmood" ( ID = 11) and in Detail Table only 1 Record shown with UID = 11 and Pet = Cat

Now I want to Locate on detail Table :

DetailTable.Locate('Pet', 'Dog', [])

"Locate" above returns " TRUE " whereas there is no Record with "Dog" value in details of Selected User

How can I solve this Problem ?

I want to Search in details of Selected Record in Master Table

Thanks before ...


TCustomADODataSet.LocateRecord works on an unfiltered clone, specify all relevant fields in your search:

DetailTable.Locate('UID; Pet', VarArrayOf([11, 'Dog']), [])
0

精彩评论

暂无评论...
验证码 换一张
取 消