Retrieving version of VFP OLE DB provider
By Sergey - Posted on April 16th, 2008
A version of VFP OLE DB provider installed on computer can be retrieved from provider itself or from its DLL through the registry.
| This is sample code. Add error handling and adjust to your requirements as necessary. |
&& From provider loConn = CREATEOBJECT("ADODB.Connection") lcPath = _vfp.DefaultFilePath loConn.ConnectionString = "Provider=VFPOLEDB.1;Data Source=" + lcPath loConn.Open() lcVersion = loConn.Properties("Provider version").value loConn.Close() ? lcVersion
&& Through the registry #DEFINE HKEY_CLASSES_ROOT -2147483648 && Uses Registry class from west-wind.com/wwvfppd.htm loReg = NEWOBJECT("Registry", "registry.prg") && Get CLSID for VFPOLEDB lcCLSID = loReg.readregistrystring(HKEY_CLASSES_ROOT, "vfpoledb.1\CLSID", "") IF ISNULL(lcCLSID) && VFPOLEDB provider isn't installed/registered RETURN .F. ENDIF && Get full DLL name lcDllFullName = loReg.readregistrystring(HKEY_CLASSES_ROOT, ; "CLSID\" + lcCLSID + "\InprocServer32", "") DIMENSION laInfo[1] && Extract version info = AGETFILEVERSION(laInfo, lcDllFullName) lcVersion = laInfo[4] ? lcVersion
The registry class can be downloaded from http://berezniker.com/files/registry.zip
Recent comments
3 hours 53 min ago
4 days 11 hours ago
4 days 12 hours ago
1 week 12 hours ago
1 week 13 hours ago
2 weeks 1 day ago
2 weeks 1 day ago
2 weeks 4 days ago
2 weeks 4 days ago
2 weeks 6 days ago