Board index » delphi » ado query master detail question

ado query master detail question

i see clearly how to set up a relationship between master/detail using ado
table control, but can it be done with ado query?  if so, it's not as clear.

if not, what is the best way to get the detail sorted?  i dont see how that
can be done with ado table (or should i set it up as a view in ms sql first
and make that the source for the ado query?).

quite honestly, i don't see the point of ado table.  why would you ever want
to snag all the data in a table at once in no apparant order?  or am i
missing something here?

thanks for helping me not be ignorant!  :)

keith

 

Re:ado query master detail question


Quote
>i see clearly how to set up a relationship between master/detail using ado
>table control, but can it be done with ado query?  if so, it's not as clear.

Create your query using a parameter where the parameter name is the same as the
name of the field in the master table you want to link to.
Set the datasource property of the detail dataset to a dataset connected to your
master dataset.  The parameters in your detail query will get their values from
the master dataset.

Quote
>quite honestly, i don't see the point of ado table.  

I agree with your perspective.
No one should use a TadoTable

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:ado query master detail question


Quote
>do you mean that in the "string list editor" for the TadoQuery object I
>should
>write somethign like "Select * From tblCustomerOrders Where CustomerID =
>tblCustomers.CustomerID"?

Parameters are proceeded with a colon

"Select * From tblCustomerOrders Where CustomerID =
  :CustomerID"

Quote
>I dont see any properties in TadoQuery for master/detail.  I only see those
>in TadoTable.

Parameter values come from the dataset the Tadodataset.datasource property is
pointing to.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads