Home Many to many relation hookup in Delphi
Reply: 0

Many to many relation hookup in Delphi

user1537 Published in July 23, 2018, 3:54 am

How do I do a many to many (master-master) relation in Delphi, I cannot find an example. Only dblookups and master-detail which I understand.

Like a product can belong to one or more categories. Like this table structure:

Product Table

ProductId, ProductName


CategoryId, CategoryName

Relation table

ProductId, CategoryId

Ideally if you select a record in the product grid the edit of a product in a detail record is started in the right side of the screen. In here you can edit the product properties an ideally you can select via checkboxes one or more categories in a checkbox group/grid.

How do you hook this up with TTable of TQuery components? Is there a way?

Hope you can help!

Sincerely Edward

Some more explaination:

The goal is like:

master [product grid list]    Detail [on selected product]
                              property **A**
                              property **B**
                              property **C**
                              property **D**
                              property **Category collection**
                                       Category 1 - checked
                                       Category 2 - unchecked
                                       Category 3 - unchecked
                                       Category 4 - checked
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.316837 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO