J
Joe at NC State
We have dozens of MS Access databases on our shared network space, each
of which contains a number of objects linked to various Sybase
databases. Because our IT people are in the process of replacing three
of their Sybase servers, we've had to change a number of our ODBC data
sources to reflect the new server names. The old data sources will be
no good after the existing servers are retired in the next month or so.
Bottom line, to keep from having to manually relink every Sybase object
in every Access database stored on our network (of which there are
literally dozens), we really need to create some type of module or
function that for a given database would look through all Sybase ODBC
linked tables for any occurrences of this:
ODBC;DSN=[old DSN name];SRVR=[old Sybase server name];
....and replace each one with this:
ODBC;DSN=[new DSN name];SRVR=[new Sybase server name];
The rest of the connection string for each object (i.e., the "DB" and
"TABLE" names) would remain the same for every linked object, as only
the server name & DSN name are changing. These databases have all
kinds of links to all kinds of objects (Sybase, SQL Server, other
Access databases, and sometimes even Excel and/or text files), but only
the specific Sybase data sources that I would specify in the code would
need to be affected. Does that sound doable?
Incidentally, I've already tried to use Dev Ashish's code for "Relink
ODBC tables from code" found in The Access Web site (at
http://www.mvps.org/access/tables/tbl0010.htm), but it didn't work for
me. It seems to work only if your linked objects are SQL Server, not
Sybase. There's a similar solution on Microsoft's website (ACC2000:
Procedure to Create Data Sources and Relink ODBC Tables - article
#208295 dated 6/24/04), but like Dev Ashish's code, it works only on
SQL Server objects (it says so). I even tried changing one of the
parameters on the "DBEngine.RegisterDatabase" subroutine from "SQL
Server" to "Sybase ASE ODBC Driver" (the driver we use for our Sybase
data sources), but that didn't work either. I also tried an alternate
solution by Dev Ashish, some code called "fRefreshLinks" also found in
The Access Web site (at tbl0009.htm, same URL cited above), but that
didn't work either -- it wouldn't really do anything.
The alternative (i.e., doing the "manual thing" described above) is
extremely tedious, time-consuming, and leaves much room for error. Our
time frame is less than a month. Whatever advice or direction anyone
could give would be greatly appreciated.
of which contains a number of objects linked to various Sybase
databases. Because our IT people are in the process of replacing three
of their Sybase servers, we've had to change a number of our ODBC data
sources to reflect the new server names. The old data sources will be
no good after the existing servers are retired in the next month or so.
Bottom line, to keep from having to manually relink every Sybase object
in every Access database stored on our network (of which there are
literally dozens), we really need to create some type of module or
function that for a given database would look through all Sybase ODBC
linked tables for any occurrences of this:
ODBC;DSN=[old DSN name];SRVR=[old Sybase server name];
....and replace each one with this:
ODBC;DSN=[new DSN name];SRVR=[new Sybase server name];
The rest of the connection string for each object (i.e., the "DB" and
"TABLE" names) would remain the same for every linked object, as only
the server name & DSN name are changing. These databases have all
kinds of links to all kinds of objects (Sybase, SQL Server, other
Access databases, and sometimes even Excel and/or text files), but only
the specific Sybase data sources that I would specify in the code would
need to be affected. Does that sound doable?
Incidentally, I've already tried to use Dev Ashish's code for "Relink
ODBC tables from code" found in The Access Web site (at
http://www.mvps.org/access/tables/tbl0010.htm), but it didn't work for
me. It seems to work only if your linked objects are SQL Server, not
Sybase. There's a similar solution on Microsoft's website (ACC2000:
Procedure to Create Data Sources and Relink ODBC Tables - article
#208295 dated 6/24/04), but like Dev Ashish's code, it works only on
SQL Server objects (it says so). I even tried changing one of the
parameters on the "DBEngine.RegisterDatabase" subroutine from "SQL
Server" to "Sybase ASE ODBC Driver" (the driver we use for our Sybase
data sources), but that didn't work either. I also tried an alternate
solution by Dev Ashish, some code called "fRefreshLinks" also found in
The Access Web site (at tbl0009.htm, same URL cited above), but that
didn't work either -- it wouldn't really do anything.
The alternative (i.e., doing the "manual thing" described above) is
extremely tedious, time-consuming, and leaves much room for error. Our
time frame is less than a month. Whatever advice or direction anyone
could give would be greatly appreciated.