Board index » delphi » I can't open DBase files with Excel

I can't open DBase files with Excel

I create DBase files with Delphi 4 and I can't open it with Excel.

This doesn't even work with the exemple which is in the help file
adapted to Dbase files.

here is the code that I use :

procedure TForm1.Button1Click(Sender: TObject);
begin
  with Table1 do
  begin
    Active := False;  { The Table component must not be active }

    { First, describe the type of table and give it a name }
    DatabaseName := 'C:\DATA';
    TableType := TTDbase;
    TableName := 'Example';

    { Next, describe the fields in the table }
    with FieldDefs do
    begin
      Clear;
      Add('Field1', ftString, 10, False);
      Add('Field2', ftString, 30, False);
    end;

    { Next, describe any indexes }
    IndexDefs.Clear;

    { Now that we have specified what we want, create the table }
    CreateTable;
  end;
end;

 

Re:I can't open DBase files with Excel


On Wed, 08 Sep 1999 15:01:58 +0200, Laurent Mathieu

Quote
<Laurent.Math...@sita.int> wrote:
>I create DBase files with Delphi 4 and I can't open it with Excel.

Probably because you're creating a level 7 dBase file.

Add this to your code:
  Table1.TableLevel := 3;  //(or 4)

Jan

Other Threads