これは、ヘッダーに autoopen (.MDX) インデックス フラグがあるように聞こえますが、インデックスはデータベースに存在しません。
これを試すことができます-データベースヘッダーのautoopenフラグをクリアします。データベースのコピーを使用してテストしてください!!! 私は DBase IV でテストしていませんが、FoxPro と DBase のいくつかのフレーバーで動作します。
procedure FixDBFHeader(const FileName: string);
var
ByteRead: Byte;
Stream: TFileStream;
begin
Stream := TFileStream.Create(FileName, fmOpenReadWrite or fmShareDenyNone);
try
// Byte offset 28 has a value of 0x01 if a structural (auto-open) index exists,
// or 0x00 if no such index exists. If the value is not set, we do nothing.
Stream.Position := 28;
Stream.Read(ByteRead, SizeOf(ByteRead));
if ByteRead = 1 then
begin
ByteRead := 0;
Stream.Position := 28;
Stream.Write(ByteRead, SizeOf(Byte));
end;
finally
Stream.Free;
end;
end;
ヘッダーのフラグをクリアすると、ADO またはAdvantage データベース サーバーで .DBF を開くことができるようになります。ローカル サーバーは無料で、SQL をサポートしています。私はアドバンテージとは何の関係もありません。私は彼らの製品を使用して、レガシー DBF ファイルを長い間操作してきました。