problem using two dataset linked through parameters.

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
alexandrenicolas
Posts: 7
Joined: Fri 15 Mar 2019 14:12

problem using two dataset linked through parameters.

Post by alexandrenicolas » Fri 26 Nov 2021 18:06

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

Stellar
Devart Team
Posts: 470
Joined: Tue 03 Oct 2017 11:00

Re: problem using two dataset linked through parameters.

Post by Stellar » Fri 03 Dec 2021 10:38

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

saundersmar
Posts: 1
Joined: Wed 05 Jan 2022 06:56

Re: problem using two dataset linked through parameters.

Post by saundersmar » Wed 05 Jan 2022 07:00

Your problem is quite similar to mine Moto X3M

alexhaifa
Posts: 18
Joined: Thu 29 May 2014 12:48

Re: problem using two dataset linked through parameters.

Post by alexhaifa » Wed 05 Jan 2022 13:40

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

pavelpd
Devart Team
Posts: 5
Joined: Thu 06 Jan 2022 14:16

Re: problem using two dataset linked through parameters.

Post by pavelpd » Tue 18 Jan 2022 16:14

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).

Post Reply