Hello,
Is it possible to obtain them, so I can check, for example, that MySQL ODBC is installed or not at ODBC system?.
Thank you very much.
Best regards
if !CheckMySQL_ODBC_Status('MySQL ODBC 5.2a Driver') // ODBC Driver installed or not
MsgInfo("MySQL ODBC 5.2a Driver is not installed in this PC")
Return NIL
Endif
*-----------------------------------*
Function CheckMySQL_ODBC_Status(cDriver)
*-----------------------------------*
// cDriver can be either 'MySQL ODBC 3.51 Driver' OR 'MySQL ODBC 5.1 Driver'
Local oReg,cStatus,lStatus:=.F.
oReg := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" )
cStatus:=""
cStatus:= oReg:Get( cDriver, cStatus ) // If installed cStatus would have a value "Installed" else empty
oReg:Close()
lStatus:=iif( cStatus == "Installed",.T.,.F.)
Return lStatus
anserkk wrote:
- Code: Select all Expand view
if !CheckMySQL_ODBC_Status('MySQL ODBC 5.2a Driver') // ODBC Driver installed or not
MsgInfo("MySQL ODBC 5.2a Driver is not installed in this PC")
Return NIL
Endif
*-----------------------------------*
Function CheckMySQL_ODBC_Status(cDriver)
*-----------------------------------*
// cDriver can be either 'MySQL ODBC 3.51 Driver' OR 'MySQL ODBC 5.1 Driver'
Local oReg,cStatus,lStatus:=.F.
oReg := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" )
cStatus:=""
cStatus:= oReg:Get( cDriver, cStatus ) // If installed cStatus would have a value "Installed" else empty
oReg:Close()
lStatus:=iif( cStatus == "Installed",.T.,.F.)
Return lStatus
Regards
Anser
oReg := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers" )
When we make a generic application/library can we assume every user can access registry? It is common that many net work administrators severely restrict rights of network users.
But can't all programs read the registry? It seems that most programs need to be able to do this. It would be a problem if only the programs administrators were using could.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Natter and 33 guests