strange behaviour in new component (master detail)

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

strange behaviour in new component (master detail)

Post by lifeform » Mon 25 Aug 2008 04:38

hello
i have master and detail list
master have to save and detail just show the info of master record
when the master not post the detail info not show up. how ever it;s work when i use sdac 4.3 version.

the detail linked to master. detail mastersource filled to datasource og master. and i use query parameter to link it

how to fix it?
Last edited by lifeform on Mon 25 Aug 2008 05:10, edited 1 time in total.

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Mon 25 Aug 2008 04:45

how strange... i rollback the component to 4.35 version
and the application run perfectly

when i use the 4.50.36 or 4.50.37 the program not complete.
it's very strange behaviour because i use the new version. not the old ones.

for the example:

i use 2 TMSQuery. 2TMSDatasource
the first i named master and the second i named it detail
the detail query masterSource i linked to master datasource
for the exampe the field in master query is supplierID and date
and sql in detail query is

Code: Select all

select * from item where SupplierID = :supplierID
when i run the program i click the button that i send the value '0001' to supplierID in master query
for the example

Code: Select all

  masterQuery.fieldByName('supplierID').value := '0001'
i not post the master query because i need to cek the some parameter
and before post the master query i need the detail query to show the result. (this can be done in sdac ver 4.35)


please tell me how to fix it in the new version of component.

thx

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

Post by Dimon » Wed 27 Aug 2008 11:33

I could not reproduce the problem.
Please send me a complete small sample at dmitryg*devart*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE.

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Sun 31 Aug 2008 07:37

i already sent the small example for you
please check and confirm

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

Post by Dimon » Mon 01 Sep 2008 12:39

Thank you for information. We have reproduced the problem.
This behaviour has been changed for perfomance increase on records inserting, because when using master/detail relationship the existence of a detail record presupposes the existence of a master record.
To view the existing record you can use the Filter property. You can look at the example of using this property in the FilterAndIndex demo of the SDAC demo.

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Mon 08 Sep 2008 13:19

Dimon wrote:Thank you for information. We have reproduced the problem.
This behaviour has been changed for perfomance increase on records inserting, because when using master/detail relationship the existence of a detail record presupposes the existence of a master record.
To view the existing record you can use the Filter property. You can look at the example of using this property in the FilterAndIndex demo of the SDAC demo.
because i really need this function that i describe above, how to force it to get like that?
if i use filter, it's will be very slow because i must transfer all date to client program. please tell me how to done it well

thx

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

Post by Dimon » Mon 08 Sep 2008 15:01

We have investigated the problem. We will add the possibility of using the old behavior in the next SDAC build.

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Sun 14 Sep 2008 07:39

ok i will be waiting before update

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Mon 22 Sep 2008 15:54

I have try your new build version 4.50.39
and the problem of mine still cannot solved...
and you promised me to add possibility of old behavior master detail
if you have done with this how to make it work in old behavior?
i have try activated the local master detail but the master detail cannot work properly

please help and thx before

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

Post by Dimon » Tue 23 Sep 2008 06:46

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.

ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

Post by ccmcbride » Tue 23 Sep 2008 20:09

Does that have to be in a specific place?
I added to my global form's initialization logic, but doesn't seem to be working.
Please note : my detail table is already open.
I do an insert on the master, and my detail doesn't keep up.

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Wed 24 Sep 2008 01:52

it's work for me
i do it in my form parent after the form created and before the query activated
i just add line "refreshParamOnInsert:=True"
it's done. my app works well.
absolutely thx for SDAC developer

ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

Post by ccmcbride » Wed 24 Sep 2008 01:57

I moved it to when my main form is created, before the datamodules get created, still not working.
Is there another setting that effects it?

lifeform
Posts: 21
Joined: Wed 02 Jan 2008 05:34

Post by lifeform » Wed 24 Sep 2008 02:33

this master detail linked by parameter in SQL statement
so this detail query need to declared the datasource
and my app use it when the master query in insert or edit state mode
try to insert new record that the ID linked to detail query that param refer to the ID
and i don't use fetchAll. but i thinkn this is not effect the behaviour of master detail.

if you use datamodule i think that the line of RefreshParamOnInsert should be put after form create and/or before the query activated
i just make suggestion here because i don't really understand how the SDAC really work. i make suggestion depend on trying and error that i got.

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

Post by Dimon » Wed 24 Sep 2008 06:41

You can set RefreshParamOnInsert to True in any place before opening tables, that takes part in master/detail relationship.

Post Reply