|
Subject:
|
Removing a machine data source
|
|
Posted By:
|
hamffjs
|
Post Date:
|
8/17/2006 11:34:15 AM
|
Greetings,
I recently set up a machine data source in Access so that I could link to tables in a MySQL installation. After setting up the machine data source with test settings, I would like to remove it. However, there are no delete or edit options when selecting a machine datasource in Access for linking tables.
Does anyone know how I can go about deleting the machine data source? I believe I read that it is stored in the registry, so I am guessing that may be where I need to go.
|
|
Reply By:
|
mmcdonal
|
Reply Date:
|
8/17/2006 2:07:24 PM
|
You can go to Control Panel and modify the existing data source to point to the new one. However, it should be MySQL I am thinking.
If the database is using the DSN, it is just a pointer and will take whatever connection information is there when it accesses it by name.
mmcdonal
|
|
Reply By:
|
mmcdonal
|
Reply Date:
|
8/17/2006 2:10:22 PM
|
Here is the code to write a SQL Server DSN from VBA or vbs:
Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\DSNName\Database", "DatabaseName" WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\DSNName\Driver", "C:\Windows\System32\\SQLSRV32.dll" WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\DSNName\LastUser", "DefaultUserName" WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\DSNName\Server", "S_SQLServerName" WshShell.RegWrite "HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources\DSNName", "SQL Server"
So this should give you an ideea of where to look in the registry.
mmcdonal
|
|
Reply By:
|
hamffjs
|
Reply Date:
|
8/21/2006 10:03:52 AM
|
Thank you for the help. I have been able to find the entries in the registry.
|