Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ODBC DSN entries are HIDDEN but they exist in the Windows Registry

ODBC DSN entries are HIDDEN but they exist in the Windows Registry

ODBC DSN entries are HIDDEN but they exist in the Windows Registry

In reference to closed thread: thread706-384881

and regarding this similar post:

I have not yet determined how this occurs but when the following value is blank, all of the existing ODBC configurations become COMPLETELY HIDDEN from the user –- whether using the ODBCAD32.EXE tool or when any application prompts the user with a list of pre-configured ODBC connections that truly do exist on their local computer.

2. Navigate to HKLM > SOFTWARE > ODBC > ODBC.INI > ODBC Data Sources
3. In the right pane, the entry "(Default)" has a Data value of blank.

I am able to manually resolve this issue:
1. Simply right-click the "(Default)" entry and choose delete. After confirming deletion, the system will immediately recreate that REG_SZ entry ... only this time properly setting its value to "(value not set)".
2. Refresh the ODBCAD32.EXE window and all of the ODBC configured connections reappear.

This occurs on many of our machines running WinXP SP2.

I would like to be able to automate the correcting (change or delete) of this registry value, using WSH scripting, but I do not know how to manipulate that particular entry. Any suggestions?


RE: ODBC DSN entries are HIDDEN but they exist in the Windows Registry

If you delete the ODBC Data Sources entry from the registry, it will be recreated at the time a child is added to the registry as such:

Option Explicit

Dim WSHShell_hacks
Set WSHShell_hacks = WScript.CreateObject("WScript.Shell")

' =================================================================================================
' MASTER ODBC that, when value is not "(value not set)", will hide all of the ODBC from the viewer.
' By deleting it first, it will be auto-created when the first child is written AND will have the
' proper value of "(value not set)" for this master entry.
' =================================================================================================

' =========================================================================
' Establish ODBC configuration as system DSN for SOME_SQL_DB:
' =========================================================================
WSHShell_hacks.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\sysdsn_some_sql_db", "SQL Server", "REG_SZ"

WSHShell_hacks.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\sysdsn_some_sql_db\Database", "some_sql_db", "REG_SZ"

WSHShell_hacks.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\sysdsn_some_sql_db\Description", "some database", "REG_SZ"

WSHShell_hacks.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\sysdsn_some_sql_db\Driver", "C:\Windows\system32\SQLSRV32.dll", "REG_SZ"

WSHShell_hacks.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\sysdsn_some_sql_db\Server", "\instance_name", "REG_SZ"

WSHShell_hacks.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\sysdsn_some_sql_db\Trusted_Connection", "Yes", "REG_SZ"

Set WSHShell_hacks = Nothing

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close