Icon View Incident Report

Serious Serious
Reported By: Rich Walker
Reported On: 6/25/2002
For: Version 3.10 Build 1
# 1146 RepairTable Method of TDBISAMTable Component Always Returns False When Using ForceIndexRebuild=True

I just noticed that RepairTable(True) always seems to return False, even on a brand new uncorrupted table. The following code demonstrates the problem.

  // Create a brand new table Temp99
  qryCreate.DatabaseName := ExtractFilePath(Application.ExeName);

  with qryCreate.SQL do begin
    Clear;
    Add('DROP TABLE IF EXISTS "temp99";');

    Add('CREATE TABLE IF NOT EXISTS "temp99"');
    Add('(');
    Add('   "ID" AUTOINC,');
    Add('   "Field1" CHARACTER(10),');
    Add('PRIMARY KEY ("ID") COMPRESS NONE');
    Add('LANGUAGE "ANSI Standard" SORT "Default Order"');
    Add('USER MAJOR VERSION 1');
    Add(');');
  end;

  qryCreate.ExecSQL;

  tblTemp99.DatabaseName := ExtractFilePath(Application.ExeName);
  tblTemp99.TableName := 'temp99';
  tblTemp99.Exclusive := True;

  // VerifyTable returns the correct result
  if tblTemp99.VerifyTable then begin
    ShowMessage('VerifyTable succeeded as expected'); 
  end else begin
    ShowMessage('VerifyTable failed');
  end;

  // RepairTable returns the correct result
  if tblTemp99.RepairTable then begin
    ShowMessage('RepairTable succeeded as expected'); 
  end else begin
    ShowMessage('RepairTable failed');
  end;

  // But RepairTable(True) always seems to return False,
  // even though the table 
wasn't damaged
  if tblTemp99.RepairTable(True) then begin
    ShowMessage('RepairTable(True) 
succeeded');
  end else begin
    ShowMessage('RepairTable(True) 
failed, why?'); 
  end;



Resolution Resolution
Fixed Problem on 7/1/2002 in version 3.11 build 1
Image