Board index » delphi » Master Detail using ADO, best way?

Master Detail using ADO, best way?

leapin,

   Use two TADOQuerys/TADODataSets.  Never use table based components
(TTable/TADOTable) with a SQL based server.

Good luck,
krf

Quote
leapin <wa...@resa.net> wrote in message news:3c5ac58e$1_1@dnews...
> What is the best way to handle a Master Detail design.
> We used to use 2  twwTable components, One was set up for the master
record,
> the second for the Detail with master info filled on for the necessary
> properties.
> Since we use MS SQL Sever 7 and ADO now, How should we best handle this
same
> design.  We are trying to avoid using adoTable components via suggestions
> from this newsgroup.  In this particular form we have 2 twwGrids
(Infopower
> 200) Delphi 5.  Thanks.

 

Re:Master Detail using ADO, best way?


What is the best way to handle a Master Detail design.
We used to use 2  twwTable components, One was set up for the master record,
the second for the Detail with master info filled on for the necessary
properties.
Since we use MS SQL Sever 7 and ADO now, How should we best handle this same
design.  We are trying to avoid using adoTable components via suggestions
from this newsgroup.  In this particular form we have 2 twwGrids (Infopower
200) Delphi 5.  Thanks.

Re:Master Detail using ADO, best way?


leapin,

Use a tadoquery for the first to return your master record.
Use a second adoquery with a condition in it's where clause that uses a
parameter for the key informatoin contained in the first query. It needs to
have a datasource pointing to the first query. Make sure you open the first
one before the second one.

Ex
Master SQL
select AccountNumber, Name from ClientsTbl

Detail SQL
select * from PaymentsTbl where (AccountNumber = :AccountNumber)

Mike Walsh

Quote
"leapin" <wa...@resa.net> wrote in message news:3c5ac58e$1_1@dnews...
> What is the best way to handle a Master Detail design.
> We used to use 2  twwTable components, One was set up for the master
record,
> the second for the Detail with master info filled on for the necessary
> properties.
> Since we use MS SQL Sever 7 and ADO now, How should we best handle this
same
> design.  We are trying to avoid using adoTable components via suggestions
> from this newsgroup.  In this particular form we have 2 twwGrids
(Infopower
> 200) Delphi 5.  Thanks.

Other Threads