Delphi(程序人生)

Delphi Programer DoubleCat

导航

检测系统是否已安装了ADO(用ACCESS库时常用)

uses registry;

    function Tform1.ADOInstalled:Boolean;

    var

    r:TRegistry;

    s:string;

    begin

      r := TRegistry.create;

      try

      with r do

      begin

        RootKey := HKEY_CLASSES_ROOT;

        OpenKey( '\ADODB.Connection\CurVer', false );

        s := ReadString('');

        if s <> '' then Result := True

        else Result := False;

        CloseKey;

      end;

      finally

       r.free;

      end;

    end;

    procedure TForm1.Button1Click(Sender: TObject);

    begin

     if ADOInstalled then showmessage('this computer has installed ADO');

    end;

posted on 2008-06-14 17:13  DoubleCat  阅读(357)  评论(0编辑  收藏  举报