K
kingkong
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
tbl:ttable;
begin
tbl:=ttable.create(self);
with tbl do
begin
DatabaseName:='DefaultDD';
tablename:='c:/aaaa/Test.dbf';
with fielddefs do
begin
clear;
add('No',ftInteger,0,false);
add('Name',ftString,0,false);
end;
with indexdefs do
begin
clear;
add('primary','no',[ixPrimary,ixUnique]);
end;
CreateTable;
end;
DataSource1.DataSet:=tbl;
DBGrid1.DataSource:=DataSource1;
tbl.Active:=True;
end;
var
tbl:ttable;
begin
tbl:=ttable.create(self);
with tbl do
begin
DatabaseName:='DefaultDD';
tablename:='c:/aaaa/Test.dbf';
with fielddefs do
begin
clear;
add('No',ftInteger,0,false);
add('Name',ftString,0,false);
end;
with indexdefs do
begin
clear;
add('primary','no',[ixPrimary,ixUnique]);
end;
CreateTable;
end;
DataSource1.DataSet:=tbl;
DBGrid1.DataSource:=DataSource1;
tbl.Active:=True;
end;