Master - Detail - Detail queries & DBGrids 
Author Message
 Master - Detail - Detail queries & DBGrids

D2 / D1(not the patch) have some serious problems in handling master -
detail - detail
queries. I wonder if any one else has noticed this.

Client : delphi 2.0, Win95, MSSQL 6.0 Client (Named Pipes).
Server : WinNT 3.51, MS SQL 6.0.

Three database tables,
  table1 (field1 int, field2 varchar (255)), primary key = field1
  table2  (field1 int, field2 int, field3 varchar (255)), primary key =
field1, field2, fkey = field1 on table1.
  table3 (field1 int, field2 int, field3 int, field4 varchar (255)),
primary key = field1, field2, field3,
fkey = field1, field2 on table2.

Record distribution is a 1 : 10 ratio. (10 detail records for each parent
record, with master table containing 10 records).

Query1.SQL =
  "Select * from table1". "
Query2.SQL =
  "Select * from table2 where field1 = :field1"
  "Select * from table3 where field1 = :field1 and field2 = :field2"

Datasource1.Dataset := Query1.
Datasource.Dataset := Query2.
Datasource.Dataset := Query3.
Query2.Datasource := Datasource1.
Query3.Datasource := Datasource2.

Three DBGrids (DBGrid1.Datasource := Datasource1, DBGrid2.Datasource :=
DBGrid3.Datasource := Datasource3).

Open all three queries (Query1.Open, Query2.Open, Query3.Open). Scrolling
down in DBGrid2 reveals that Delphi / BDE fetches only the no. of rows
from Query2 that are visible in the grid.
If no grid is present (use only edit controls & a navigator) only one row
from Query2 is fetched.
If the grid is extended (at design time to show 5 rows), 5 rows are
fetched from the tables.

Any comments from TeamB on this? Is it fixed in the Delphi 2.01 upgrade?


Sun, 20 Dec 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Master->Detail->Detail Query Too Slow

2. Master-Detail : Sorting Detail?

3. Setting report variables in the detail of a ReportSmith master-detail report

4. Master-detail-detail-detial with Cascade delete

5. Master/Detail lookup - losing detail field

6. Newbie - updating Detail in master-detail

7. HELP: Master-detail form: sequence of detail records

8. Sorting detail records in a master detail relation.

9. Problem when inserting records in the detail table (master/detail relation)

10. Different detail Index order within master-detail relationship

11. DBGrid master/detail relationship?

12. Yet Another Master/Detail Sorting Query


Powered by phpBB® Forum Software