Depending on the type of ODB connection it can also be in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

Changing this line
 Code:
If KeyExist("HKCU\Software\ODBC\ODBC.INI\"+$odbcName)


to

 Code:
If KeyExist("HKCU\Software\ODBC\ODBC.INI\" + $odbcName) Or KeyExist("HKLM\Software\ODBC\ODBC.INI\" + $odbcName)


would cover both location.

Creating two If statements that each check their own registry location would be better IMHO because it will create a log entry for one or both ODBC connections.


Edited by Mart (2013-03-05 04:26 PM)
Edit Reason: Added some code.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.