Adding a Field to DBF Database. 
Author Message
 Adding a Field to DBF Database.

How can I use tbTable.FieldDefs.Create ? This seems to be another of
those methods inadequately defined in Help-GRRR
Email reply if possible.



Wed, 18 Jun 1902 08:00:00 GMT  
 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



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Apollo DBE, Add a field to existing DBF?

2. Add a new Database field to a already-existing Paradox table at RUNTIME

3. Adding List Items From Database Fields

4. Adding a New Field to an existing Database Table

5. Adding new fields to a database How?

6. Adding filenames as Database Fields

7. Add Fields To Database

8. Create database and add field during run time ??

9. add expression index to dbf file

10. Quirk: DBF IndexDefs.Add vs. AddIndex

11. Pictures in an dbf file and adding new ones

12. add/delete dbf record in pascal

 

 
Powered by phpBB® Forum Software