Page 1 of 1
Master/Detail problem when master tbl is in [DsInsert] state
Posted: Tue 09 Mar 2010 12:28
by enzorubino
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.
Re: Master/Detail problem when master tbl is in [DsInsert] state
Posted: Wed 21 Apr 2010 22:08
by guto1234
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.
Posted: Thu 22 Apr 2010 07:18
by Dimon
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.
Problem solved
Posted: Thu 22 Apr 2010 12:47
by guto1234
thanks, that is the exact solution for the reported issue