Page 1 of 1

problem using two dataset linked through parameters.

Posted: Fri 26 Nov 2021 18:06
by alexandrenicolas
Hello,

I am having a problem with two tables linked by parameters, when I go to the last row, the second table doen't show the last register. I am gonna detail all the problems bellow.

My form has:

1 dbnavigator
2 dbgrid
2 TsqlQuery
2 TDataSetProvider
2 TClientDatase
2 TDataSource

The first TsqlQuery has this SQL query:
select a.codcad, b.nomcad, a.datped, a.numped, a.seqped from arfat a
inner join arcad b on (b.codcad=a.codcad)

The second TsqlQuery has this SQL query:
select a.codpro, b.nompro, a.numped, a.seqped, a.seq from arifat a
inner join arest b on (b.codpro=a.codpro)
where a.numped=:numped and a.seqped=:seqped


as you can see, I have two parameter in my second TSQLquery,

I linked all the components TSQLQuery -> TDataSetProvider -> TClientDatase -> TDataSource

My dbNavigator is connected with the FIRST DataSource. When I go to the last row in my dbgrid1, on the event afterScroll of DataSet1 I close and open the segund DataSet so that Can show the register linked throught the parameters as you can see in the second SQL query, but it doens't display the records. To solve the problem, I have to return one row and then go to the last again so that my dataset can display the rows linked with my dataset 1

I made the same test with Ado components and it worked very fine.

Please, I need this corrected as soon as possible once I am having many problems with my system on my costumers.

If you need, I can send you a simple project to be analised.

regards
Alexandre

Re: problem using two dataset linked through parameters.

Posted: Fri 03 Dec 2021 10:38
by Stellar
HI,
Thanks for your request.

To investigate this behavior of dbExpress Driver for SQL Server, please compose a small sample demonstrating the issue and send it to us, including database objects creating scripts.
You can send the sample using the contact form at our site: devart.com/company/contactform.html

Best regards,
Sergey

Re: problem using two dataset linked through parameters.

Posted: Wed 05 Jan 2022 07:00
by saundersmar
Your problem is quite similar to mine Moto X3M

Re: problem using two dataset linked through parameters.

Posted: Wed 05 Jan 2022 13:40
by alexhaifa
I've just sent an example with the problem.
Please, fix that as soon as possible, that is impacting many applications of mine.
Regards
Alexandre

Re: problem using two dataset linked through parameters.

Posted: Tue 18 Jan 2022 16:14
by pavelpd
Thank you for the provided sample. The issue you have described also can be reproduced when using the standard DBX driver (QueryParametro sample).
Please feel free to contact Embarcadero to get their help and to request the fix from them for this functionality.
As a workaround solution from our end we can recommend you to set the parameters values by yourself (please refer to the QueryParametro2 sample).