Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2006, 11:34 AM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Removing a machine data source

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.

 
Old August 17th, 2006, 02:07 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
 
Old August 17th, 2006, 02:10 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
 
Old August 21st, 2006, 10:03 AM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the help. I have been able to find the entries in the registry.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Retore Db from a remote machine to a local machine srkvellanki BOOK: Beginning SQL 0 October 3rd, 2008 05:17 PM
removing "data connections" jerryham VB.NET 3 September 25th, 2008 11:09 AM
Machine.config and data application block beachboy1976 ASP.NET 1.0 and 1.1 Professional 0 August 9th, 2006 03:01 PM
Getting data from machine askenkray Beginning VB 6 2 January 21st, 2005 10:47 PM
Transfering data from one machine to another..... nikosdra SQL Server 2000 0 September 6th, 2003 05:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.