Knowledge Base

HOWTO: Use COMCLASSINFO() to Check Installed ADO Version

Article ID: 191375

Article Last Modified on 7/13/2004


APPLIES TO


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.

REFERENCES

Visual FoxPro Help, version 6.0; search on: "COMClassInfo()"

Additional query words: kbDatabase kbVFp600 kbADO

Keywords: kbhowto kbdatabase KB191375