|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by jjcc9432 in Delphi Programming, Delphi Database
I am trying to run batch queries for a project I am on. Does anyone know how to retrieve more than one recordset in delphi?
(i.e. Select * from customer
Select * from items
Should return 2 recordsets I now need to populate 2 DBGrids with each result.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
|
qry.GetDetailDataSets(dslist);
repeat
begin
wwdbGrid1.DataSource := srcQuery;
rs := qry.NextRecordset(rowcount);
if(rs <> nil) Then
begin
ds := TDataSource.Create(self);
qry.GetDetailDataSets(dslist);
tabsheet := TTabSheet.Create(PageCOntrol1);
tabsheet.Align := alClient;
tabsheet.PageControl := PageControl1;
tabsheet.Parent := PageControl1;
tabsheet.Caption := 'Query ' + IntToStr(PageControl1.PageCount + 1);
ds.DataSet := srcQuery.DataSet;
dbgrid := TwwDBGrid.Create(tabsheet);
dbgrid.DataSource := ds;
dbgrid.Align := alClient;
dbgrid.Parent := tabsheet;
tabsheet.InsertControl(dbgrid);
PageControl1.InsertControl(tabsheet);
tabsheet.Visible := true;
dbgrid.Visible := true;
PageControl1.Update;
end;
end;
until rs = nil;
|
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625