[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet4.0]
将MaxLocksPerFile键值改为自己设置的值(如:9999999)。
代码实现:
function TfrmExport.EditRegister: Boolean;
var
pReg: TRegistry;
sRegKey, sRegItem, sValue: string;
iValue, iNew: Integer;
begin
Result := False;
pReg := TRegistry.Create;
try
pReg.RootKey := HKEY_LOCAL_MACHINE;
sRegKey := ‘SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0‘;
if not pReg.OpenKey(sRegKey, false) then
begin
InfoDlg(‘键值[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0]访问失败!‘);
Exit;
end;
sRegItem := ‘MaxLocksPerFile‘;
iValue := pReg.ReadInteger(sRegItem);
sValue := IntToStr(iValue);
if not MyInputQuery(‘修改注册表‘, ‘请输入[MaxLocksPerFile]值:‘, sValue) then Exit;
if not TryStrToInt(sValue, iNew) then
begin
InfoDlg(‘输入键值不正确,修改失败!‘);
Exit;
end;
pReg.WriteInteger(sRegItem, iNew);
finally
pReg.CloseKey;
pReg.Free;
end;
end;