Monday, December 15, 2008

The Mystery of the Missing System DSNs

Have you ever created ODBC System DSNs to see them instantly vanish before your very eyes? This is a spodadic problem on Windows 2003 and XP at least. This is not the biggest problem in the world - the global recession and the wars in the Middle East are at least as bad, but its bothered me for a while. The ODBC DSNs are there in the registry and even work if called directly but will not be listed. This was only a problem for me recently when I had an app which relied on listing them so I had to actually find a solution.

In case anyone else has this, look at this registry key:
HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources

There should be a (Default) REG_SZ with a blank value. This is wrong - it should say "Value Not Set". Delete that one value and it will reproduce itself instantly, then reopen ODBC Data Sources and it suddenly notices it has DSNs!

Good old registry, never fails.

No comments:

Post a Comment