Delphi .NET (2) Database (71) Delphi IDE (89) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
Create a dBase database at runtime
This article has not been rated yet. After reading, feel free to leave comments and rate it.
The following procedure may be especially useful for temporary tables:
 | |  | |
procedure MakeDataBase;
begin
with TTable.Create(nil) do
begin
DatabaseName := 'c:\temp';
TableName := 'test.dbf';
TableType := ttDBase;
with FieldDefs do
begin
Add('F_NAME', ftString,20,false);
Add('L_NAME', ftString,30,false);
end;
CreateTable;
with IndexDefs do
begin
Clear;
AddIndex('name','Upper(L_NAME)+Upper(F_NAME)',[ixExpression]);
end;
end;
end; | |  | |  |
Comments:
|