problem using two dataset linked through parameters.
Posted: 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
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