Try this Leigh. I found this code at one of the many tip sites.
{/////////////////////////////////////////////////////////////
CheckForADO
Tells if ADO is installed in this PC
/////////////////////////////////////////////////////////////}
function CheckForADO : Boolean;
var
R : TRegistry;
begin
Result := False;
R := TRegistry.Create;
try
with R do
begin
RootKey := HKEY_CLASSES_ROOT;
OpenKey('ADODB.Connection\CurVer',False);
if ReadString('') <> '' then
Result := True;
CloseKey;
end; // With
finally
R.Free;
end; //try
end;
//-------------------------------------------------------
function GetFileVer(FileName : String) : String;
var
VerSize : DWORD;
Zero : THandle;
PBlock : Pointer;
PS : Pointer;
Size : UINT;
begin
{** Get size of Version resource **}
VerSize := GetFileVersionInfoSize(PChar(FileName),
Zero);
If VerSize = 0 Then
Begin
GetFileVer := 'Not found';
Exit;
End;
{** Allocate memory **}
GetMem(PBlock, VerSize);
{** Get Version resource **}
GetFileVersionInfo(PChar(FileName), 0, VerSize, PBlock);
If VerQueryValue(PBlock,
'\\StringFileInfo\\000004E4\\ProductVersion',PS,Size) Then
GetFileVer := StrPas(PS)
Else
If VerQueryValue(PBlock,
'\\StringFileInfo\\000004B0\\ProductVersion',PS,Size) Then
GetFileVer := StrPas(PS)
Else
GetFileVer := '?.?';
FreeMem(PBlock, VerSize);
end;
//-------------------------------------------------------
function GetADOVer : String;
var
Reg : TRegistry;
List : TStringList;
I : Integer;
CLSID : String;
begin
try
Reg := TRegistry.Create;
List := TStringList.Create;
With Reg do
begin
RootKey := HKEY_CLASSES_ROOT;
OpenKey('', False);
GetKeyNames(List);
for I := 0 To List.Count - 1 do
if Pos('ADODB.Connection', List[I]) <> 0 Then
begin
OpenKey(List[I]+'\CLSID', False);
CLSID := ReadString('');
end;
CloseKey;
OpenKey('\CLSID\'+CLSID + '\InprocServer32', False);
GetADOVer := GetFileVer(ReadString(''));
end;
finally
List.Free;
Reg.Free;
end;
end;
regards
Chris
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
>Behalf Of Leigh Wanstead
>Sent: Wednesday, 1 November 2000 14:30
>To: Multiple recipients of list delphi
>Subject: [DUG]: ADO VERSION
>
>
>Hello everyone,
>
>How to programicaly retrive ADO version installed on a computer?
>
>Thanks in advance.
>
>Best Regards
>Leigh
>
>
>---------------------------------------------------------------
>------------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>To UnSub, send email to: [EMAIL PROTECTED]
>with body of "unsubscribe delphi"
>
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"