Question

I have a Delphi application which has 2 TADODataSet objects that reference CLIENT (Master) and ORDER (detail) data. I have the 2 components linked via the DataSource and Masterfields (using ClientCode) properties and everything functions as expected. However, I've noticed a performance issue recently and have discovered that even if only just one client record is returned for for the master record set, the entire orders table is returned and then filtered for the specific client. Is this how it should function? From tracing the database activity I can see that the following SQL is being executed:

-- the one client that I wanted to view
SELECT fields FROM Client WHERE ClientCode = 1;

SELECT fields from Order; -- entire orders table

I am using Delphi 2006 BDS

Was it helpful?

Solution

You just have to watch that Masterfield is named correctly with the fieldname of your masterdataset.

here id

OTHER TIPS

Make sure the parameter types are the same in both cases, i.e. master and child.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top