A:
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, DB, DBTables, StdCtrls, Grids, DBGrids;
type
TForm1 = class(TForm)
Button1: TButton;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Table1: TTable;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
list: TList;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
list := TList.create;
with list do begin
add(TTable.create(self));
with TTable(items[count - 1]) do begin
DatabaseName := 'DBDEMOS';
TableName := 'customer.db';
name := 'foo';
open;
end;
Datasource1.DataSet := TTable(items[count - 1]);
end;
end;
end.