[AccessD] OT - Changing a DSN Connection

James Barash James at fcidms.com
Thu Jan 5 08:40:31 CST 2006


Paul:

It depends how you set up your DSN. If you use User DSN, those are stored in
the registry under Hkey_Current_User\Software\ODBC\ODBC.INI\. You could open
each Key and change the Server to AL-MASTER. If you use a System DSN, those
are stored under Hkey_Local_Machine\Software\ODBC\ODBC.INI\ and you can make
the same change. If you use a File DSN, those files are usually stored in
\Program Files\Common Files\ODBC\Data Sources\. They are just Text files so
you'd need to open each one and change the Server line.

If you know the names of the DSN ahead of time, it's much easier to write
some simple VBA to make the changes. If you need to go through all the DSNs,
it is a little more complicated but certainly possible.

I have some code somewhere for going through the registry to find specific
Keys if you need it.

Hope that helps.

James Barash

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland
(ISHARP)
Sent: Thursday, January 05, 2006 8:21 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] OT - Changing a DSN Connection

To all,

We are having a new server (very soon) and changing the name to something
like AL-MASTER from AL-ORR the thing is I have a lot of Excel management
reports which use various DSN's pointing to AL-ORR, is there something I
could write in Access or VB that a a click of a button will find these DSN's
and replace the server name ?

Any help on this would be greatly appreciated.

Thanks in advance 

Paul Hartland

P.S. Happy New Year to all list members, don't know what I would do without
it sometimes

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list