Computing.Net > Forums > Database > Hidden ODBC DSN although in Registr

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Hidden ODBC DSN although in Registr

Reply to Message Icon

Original Message
Name: Obfuscated
Date: September 19, 2008 at 11:22:49 Pacific
Subject: Hidden ODBC DSN although in Registr
OS: XP SP2
CPU/Ram: 1GB
Manufacturer/Model: Dell
Comment:

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.

1. Open REGEDIT.EXE
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?

Thanks!


Report Offensive Message For Removal


Response Number 1
Name: Obfuscated
Date: September 19, 2008 at 20:42:41 Pacific
Reply:

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.
' =================================================================================================
WSHShell_hacks.RegDelete "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\"

' =========================================================================
' 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", "10.10.5.100\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



Report Offensive Follow Up For Removal







Use following form to reply to current message:

Not Logged In!

You will not be able to post.

Register | Login
   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Hidden ODBC DSN although in Registr

Comments:



Results for: Hidden ODBC DSN although in Registr

Command line ODBC Driver Add?
    Summary: The items found in Control Panel -> Data Sources (ODBC) -> (System DSN Tab), listed under "System Data Sources" ...
www.computing.net/answers/dbase/command-line-odbc-driver-add/62.html

DataSource change when not in admin
    Summary: Hi jhunt303, I quite sure I put the ODBC in system DSN already. One more thing is the data source name I use is same name with local PC name. When I tested it with another data source name (still conn...
www.computing.net/answers/dbase/datasource-change-when-not-in-admin/19.html

Problems with ODBC (SQL)
    Summary: I am trying to connect to a SQL database and it returns the following error when I want to connect SQL Server through the System DSN in Control Panel - Administrative tools - ODBC: Connection failed: ...
www.computing.net/answers/dbase/problems-with-odbc-sql/302.html






Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History






Data Recovery Software