#2
sdta2023-10-20 19:54
|
dbf檔在第28byte記錄著是否有index,將其設為0就不會去找index了
function disableIndex(fname:string):integer;
//attempts disable .mdx by clear .dbf's byte 28
// return 1 if it has intex file
var
F:File of byte;
old,value :byte;
begin
value := 0;
try
assignFile(F, fname);
except
showmessage('can not open file:' fname);
end;
Reset(F);
Seek(F, 28);
read(F, old);
if old = 1 then begin
Seek(F, 28);
Write(F, value);
result := 1;
end
else
result := 0;
CloseFile(F);
end;