
Adding a Field to DBF Database.
On Thu, 11 Sep 1997 13:49:29 +1000, Jeff Ottery
Quote:
>How can I use tbTable.FieldDefs.Create ? This seems to be another of
>those methods inadequately defined in Help-GRRR
You wouldn't need to create it, just clear it.
procedure TForm1.Button1Click(Sender: TObject);
var
Table1: TTable;
begin
Table1 := TTable.Create(Self);
with Table1 do
begin
Active := False;
Exclusive := True;
DatabaseName := ExtractFilePath(Application.ExeName);
TableName := 'Test.DBF';
TableType := ttDBASE;
FieldDefs.Clear;
FieldDefs.Add('IntFld', ftInteger, 0, False);
FieldDefs.Add('FloatFld', ftFloat, 0, False);
FieldDefs.Add('StrFld', ftString, 10, False);
CreateTable;
Free;
end;
ShowMessage('Done');
end;
--
Wolfgang Chien
Contact my homepage at http://www.chih.com
Code Arrange Expert - http://www.chih.com/download/ca.html