Page 1 of 1

Master detail with clientdataset

Posted: Tue 19 Oct 2010 09:55
by badmood
Hi,

I'm migrating my app from your PgDAC components to UniDAC and something strange is happening.

I have two grids, one with master data and one with details. The components "chain" is qry -> dsp -> cds -> ds like when the app was built with PgDAC. For the migration, my approach is to change with a text editor the references from PgDAC to UniDAC (automatically changing only the components type from TPgQuery to TUniQuery).

But... now when I move from row to row in the master grid the detail remain empty. The same identical form with PgDAC works correctly, and I can see the details records. Obviously, no change was made to dsp, cds and ds components, so the only change is from TPgQuery to TUniQuery.

New:

Code: Select all

  object qryScarichiD: TUniQuery
    KeyFields = 'id_magazzino;id;segno'
    Connection = dmMain.DBConnection1
    SQL.Strings = (
      'SELECT * FROM movimenti_d WHERE id_movimento_t = :id;')
    Left = 552
    Top = 472
    ParamData = 
  end
Old:

Code: Select all

  object qryScarichiD: TPgQuery
    KeyFields = 'id_magazzino;id;segno'
    Connection = dmMain.DBConnection1
    SQL.Strings = (
      'SELECT * FROM movimenti_d WHERE id_movimento_t = :id;')
    Left = 552
    Top = 472
    ParamData = 
  end
To me, they looks identical.

Any hint?

Sergio

PS: Delphi XE and UniDAC 3.50.12

Posted: Wed 20 Oct 2010 08:19
by AlexP
Hello,

Please check your master-detail relation, as I see you link the tables manualy, may be you have forgotten to replace the event where you link the tables.

Posted: Wed 20 Oct 2010 09:00
by badmood
Hi,

for what I know, the clientdataset component do automatically the "movement" in the detail recordset when you change position in the master (if you define the master dataset and the key fields at component level in the detail clientdataset). It works in every app that I've done, either with IBX components and PgDAC components. Changing to UniDAC TUniQuery as source for dataset provider does not work, while when I was using a TPgQuery component yes.

In other words, there is no code/events involved in the relation.

And - as I wrote before - the change was only on the text portion of the .dfm and .pas files changed from TPgQuery to TUniQuery (and on Uni added to the units section of the .pas) so it seems to me that is a component problem, but if you have any ideas I can check it immediately.

Thanks in advance.

Sergio