Icon View Incident Report

Serious Serious
Reported By: Guenter Angerer
Reported On: 3/15/2001
For: Version 2.08 Build 1
# 765 Closing a Table Not Freeing an Internal Structure Causing Exists Function to Fail

The following code causes the Exists function to fail and report that the table exists when it doesn't:

Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, 
Dialogs,
  StdCtrls, DBISAMTb;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

uses db;

procedure TForm1.Button1Click(Sender: TObject);
var lTable: TDBIsamTable;
begin
  lTable := TDBIsamTable.Create(nil);
  with lTable do
  try
    TableName := 'testtable';
    try
      DeleteTable;
    except on e: exception do ;
    end;
    FieldDefs.Add('f1', ftString, 1);
    CreateTable;
    DeleteFile('testtable.dat');
    DeleteFile('testtable.idx');
    if exists then
      DeleteTable;
  finally
    free;
  end;
end;

end.



Comments Comments
This was reported several times by different customers at different times but we were never able to reproduce it until now.


Resolution Resolution
Fixed Problem on 3/16/2001 in version 2.09 build 1
Image