Foxite.COM Community Weblog

Foxite.COM Community Weblog - free weblog service for the Visual FoxPro Community.
Welcome to Foxite.COM Community Weblog Sign in | Join | Help
in
Home Blogs Forum Photos Forum Archives

Esparta Palma



HOWTO: Get MDAC Version

 Following the recomedations found in the MSKB Article: How to check for MDAC Version
? "MDAC Version: " + NVL(GetMDACVersion(),"Not installed")

FUNCTION GetMDACVersion
LOCAL lcRetValue
lcRetValue = .NULL.
#DEFINE HKEY_LOCAL_MACHINE -2147483646
TRY
oReg = NEWOBJECT("registry",HOME(1)+"ffc\registry.vcx")
lcKey = "Software\Microsoft\DataAccess"
IF oReg.OpenKey(lcKey,HKEY_LOCAL_MACHINE,.F.) = 0
lcSubKey = "Version" &&Or "FullInstallVer"
IF oReg.GetKeyValue(lcSubKey,@lcRetValue) # 0
lcRetValue = .NULL.
ENDIF
oReg.CloseKey()
ENDIF
CATCH TO oError
lcRetValue = .NULL.
FINALLY
RELEASE oReg
ENDTRY
RETURN lcRetValue
ENDFUNC

This code was a reply in a thread at the microsoft newsgroup of visual foxpro (spanish edition), it was also published at PortalFox.com, Luis María Guayán incorpore another solutions based at API calls (mine also has), the difference with my implementation was in the fact it was based on the use of OOP paradigm and using the Fox Foundation Classes.

--- Detectar si MDAC está instalado y qué versión (spanish) ---
http://www.portalfox.com/article.php?sid=1631

----------------------------
Espartaco Palma
SysOp www.PortalFox.com
México D.F.

 

Published Monday, May 09, 2005 2:23 AM by espalm

Comments

No Comments
Anonymous comments are disabled

This Blog

Post Calendar

<May 2005>
SuMoTuWeThFrSa
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

Syndication