星期二, 9月 04, 2012

判斷是否有安裝Access趨動

uses Registry;

function IsInstallAccessDatabaseEngine: boolean;
var
  reg:          TRegistry;
begin
  Result := False;
  reg:=TRegistry.Create;
  try
    reg.RootKey:=HKEY_LOCAL_MACHINE;
    if (Reg.OpenKeyReadOnly('SOFTWARE\Classes\Microsoft.ACE.OLEDB.12.0')) or
      (Reg.OpenKeyReadOnly('SOFTWARE\Wow6432Node\Classes\Microsoft.ACE.OLEDB.12.0')) then
      Result := True;
  finally
    reg.CloseKey;
    reg.Free;
  end;
end;