Master/Detail problem when master tbl is in [DsInsert] state

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
enzorubino
Posts: 7
Joined: Tue 24 Jul 2007 16:04

Master/Detail problem when master tbl is in [DsInsert] state

Post by enzorubino » Tue 09 Mar 2010 12:28

I migrate from MyDac to UniDac components in one of my applications.

Everything it's ok but Master/Detail does'nt go when master dataset is in DsInsert state, all is going instead when state is DbBrowse.

Here example code:

XDataSource := TDataSource.create (..and settings)
XQry := TUniQuery.create (...and settings)
XDataSource.dataset := XQry;
XTable := TUniTable.create (...and settings)
XTable.MasterSource:= XDataSource;

Connection is with SQLite provider.

guto1234
Posts: 3
Joined: Wed 21 Apr 2010 21:56

Re: Master/Detail problem when master tbl is in [DsInsert] state

Post by guto1234 » Wed 21 Apr 2010 22:08

I am having the same sort of problem. I am migrating from SDAC 2.8 that had this problem but was solved three years ago.
I suppose the solution was already implemented in Unidac, but in the version 3.0 for delphi 6 it is not working, yet.

Apparently, when one is inserting a record and updating the field that is a master field for a detail table, the detail table is not refreshed.



enzorubino wrote:I migrate from MyDac to UniDac components in one of my applications.

Everything it's ok but Master/Detail does'nt go when master dataset is in DsInsert state, all is going instead when state is DbBrowse.

Here example code:

XDataSource := TDataSource.create (..and settings)
XQry := TUniQuery.create (...and settings)
XDataSource.dataset := XQry;
XTable := TUniTable.create (...and settings)
XTable.MasterSource:= XDataSource;

Connection is with SQLite provider.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 22 Apr 2010 07:18

In the latest versions of DACs when master/detail relationship is used on inserting a new record into master table parameters in detail table are not updated. To restore the old behavior, you should set the RefreshParamsOnInsert variable to True in the initialization section of one of the units in your project. This varible is declared in the DBAccess unit.

guto1234
Posts: 3
Joined: Wed 21 Apr 2010 21:56

Problem solved

Post by guto1234 » Thu 22 Apr 2010 12:47

thanks, that is the exact solution for the reported issue

Post Reply