Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking if VfpOleDbf is installed?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01304728
Message ID:
01304735
Vues:
16
>>
>>There is no way to check if you don't use object or Windows API.
>>You could read registry to see if that provider is installed and registered, check http://www.devx.com/vb2themax/Tip/19250 (you easily can convert VB code to VFP)
>>If you use that approach you should use registry class or scripting host (an object). If you want to read registry directly you should use Windows API functions to do that. So there is no big difference between TRY CATCH block you used and the other method. Just a thought.
>>
>>BTW Here Windows API solution:
>>
>>#define HKEY_CLASSES_ROOT       -2147483648
>>#define ERROR_SUCCESS                    0    && OK
>>
>>
>>
>>? IsClassReg([VFPOLEDB.1])
>>
>>
>>FUNCTION IsClassReg(tcClass)
>>LOCAL lnKey
>>DECLARE INTEGER RegOpenKey IN Win32API ;
>>        INTEGER nHKey, STRING @cSubKey, INTEGER @nResult
>>
>>DECLARE INTEGER RegCloseKey IN Win32API ;
>>        INTEGER nHKey
>>
>>lnKey    = 0
>>llRetVal = (RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS)
>>
>>IF llRetVal
>>   RegCloseKey(lnKey)
>>ENDIF
>>
>>CLEAR DLLS RegOpenKey, RegCloseKey
>>RETURN llRetVal
>>
>
>Borislav,
>
>Thank you very much for your help.

You are welcome :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform