Como alterar o driver de acesso do access no bde automaticamente

Eu fiz um procedimentozinho que funciona:

procedure ChangeAccessDLL32(Dll : String); // Altera a Propriedade do BDE\Drivers\Native\MSACCESS\Dll32
var
  Reg : TRegistry;
begin
  Reg := TRegistry.Create;
  try
  Reg.RootKey := HKEY_LOCAL_MACHINE;
  if Reg.OpenKey('\Software\Borland\DataBase
Engine\Settings\Drivers\MSACCESS\INIT', True)
  then Reg.WriteString('DLL32',Dll);
  finally
  Reg.CloseKey;
  Reg.Free;
  end;
end;

-------> Use de preferência no OnCreate do Form ou DataModule da seguinte
forma:

  ChangeACCESSDll32('IDDA3532.DLL'); // Mudando a DLL de acesso ao ACCESS

Nenhum comentário:

Postar um comentário