What is the difference between the MasterSource and DataSource properties? lazarus / 16-Databases ---------------------------------------------------------------------- vfclists · 2013-06-01 05:28 What is the difference between the MasterSource and DataSource properties of a dataset? From what I understand and know from experience the DataSource points to the master source table in a master->detail link. The MasterSource also seems to do the same thing. Why the duplication? ---------------------------------------------------------------------- taazz · 2013-06-01 09:23 As far as I can see on lazarus 1.0.6 and fpc 2.6.2 the MasterSource does not exists on the TDataset or TSQLQuery from the SQLDB components, which dataset you use that has masterSource? ---------------------------------------------------------------------- jamhitz · 2013-06-01 12:14 Datasource provides a link to the underlying database table. Where available, the MasterSource points to ANOTHER TDataSet descendant that provides the MASTER half of a MASTER-DETAIL relationship through the MasterFields property. Used to employ this back in the day using Delphi. Zeos still has it, but sqlDB does not seem to employ it. ---------------------------------------------------------------------- vfclists · 2013-06-01 16:39 It is present in the Zeos package. Anyway further investigation indicates that MasterSource is used with the TTable based master->detail linking which created the links by matching field names in the master with the corresponding fields in the detail. The DataSource property is SQL based and it creates the link by using the Params property of the SQL where fields in the detail query prefixed with ':'  match the corresponding fields in the master query. Code: [Select]select * from detail where detail.master_id = :master_id Quote from: taazz on June 01, 2013, 11:23:04 amAs far as I can see on lazarus 1.0.6 and fpc 2.6.2 the MasterSource does not exists on the TDataset or TSQLQuery from the SQLDB components, which dataset you use that has masterSource?