Create a master table in SQL Server's northwide
Create Table sell_h (sell_id char (10), cust_name char (10) primary key (sell_id ))
Go
Create Table sell_h (sell_id char (10), inv char (10), AMT float, qty float primary key (sell_id, inv ))
First, pay attention to the following settings
1. Note that the qrydetail settings of the slave table are reported. The batch storage type is open. locktype = batchoptimistic, cursor = keyset, and cursorlocation = cluseclient.
2.
Procedure tform1.formcreate (Sender: tobject );
Begin
Qrymain. close;
Qrydetail. close;
Qrymain. SQL. Add ('select * From sell_h ');
Qrydetail. SQL. Add ('select * From sell_ B where sell_id =: sell_id ');
Qrymain. open;
Qrydetail. open;
End;
3.
Procedure tform1.qrymainafterscroll (Dataset: tdataset );
Begin
Qrydetail. close;
Qrydetail. Parameters. parambyname ('your _ id'). Value: = qrymain. fieldbyname ('your _ id'). value;
Qrydetail. open;
End;
The above are the main settings .. pay attention to the storage problem of Master/Slave tables:
Do not use batch processing to store the master table. Remove ltbatchoptimistic.
The schedule is processed in batches.
You can save the table list before saving the table.
From: http://blog.csdn.net/Kandy_Zheng/archive/2007/06/05/1639184.aspx