Retrieving version of VFP OLE DB provider
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
1 week 5 days ago
1 week 5 days ago
2 weeks 2 hours ago
2 weeks 1 day ago
2 weeks 2 days ago
2 weeks 5 days ago
3 weeks 5 days ago
3 weeks 6 days ago
4 weeks 14 hours ago
4 weeks 4 days ago