Microsoft KB Archive/191375

= HOWTO: Use COMCLASSINFO to Check Installed ADO Version =

Article ID: 191375

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Data Access Components 2.1 Service Pack 2
 * Microsoft Data Access Components 2.6

-



This article was previously published under Q191375



SUMMARY
This article describes how you can check the version of ActiveX Data Objects (ADO) you have installed on your computer.



MORE INFORMATION
You can use the COMCLASSINFO function that is new in Visual FoxPro 6.0 to return the ProgId of an object, which indicates the version of the object. You can use the following code to check the installed version of ADO: x=CREATEOBJECT("adodb.recordset") ? COMCLASSINFO(x,1) If ADODB.Recordset 2.0 is returned, you have ADO version 2.0 installed.

The COMCLASSINFO function can also return the object's VersionIndependentProgID, the object's friendly name and the object's class identifier or CLSID.

The same information can be returned about Microsoft Word, Microsoft Excel or practically any other application for which an object reference can be created.

Another way to check the version of ADO is to check the version property of the ADO.Connection object. The following code can be used to accomplish this: x=CREATEOBJECT("adodb.connection)  ? x.version If ADO 2.0 is the current version, 2.0 is returned. If ADO 1.5 is the current version, 1.5 is returned.

