finding location of ODBC source in Access

J

JASelep

Is there a way to list/display the source location/properties of an ODBC link
in an Access DB?

An Access MDB was backed-up before a computer was re-imaged
I'm trying to find information on the ODBC source location to re-establish
the links in the restored MDB so it will work

I got this great query from this discussion group to list regular linked
table souces in an access DB

SELECT [Name], Database, ForeignName
FROM MSysObjects
WHERE [Type]=6
ORDER BY [Name];
 
B

Bob Barrows [MVP]

JASelep said:
Is there a way to list/display the source location/properties of an
ODBC link in an Access DB?

An Access MDB was backed-up before a computer was re-imaged
I'm trying to find information on the ODBC source location to
re-establish the links in the restored MDB so it will work

I got this great query from this discussion group to list regular
linked table souces in an access DB

SELECT [Name], Database, ForeignName
FROM MSysObjects
WHERE [Type]=6
ORDER BY [Name];

ODBC DNSs are external to the Access database, so those properties are not
stored anywhere in the database. To get those properties, you have to go to
the Registry of the machine on which those DSNs were created. From the
sounds of it, you are out of luck, unless you can restore a backup of the
Registry that was done before the computer was re-imaged. I don't know
off-hand where the DSN information is stored in the Registry (especially
since this will be OS and OS version-specific), but a quick google search
should reveal it for you.
 
J

John Spencer

Open up the database and use the following in

CurrentDb().TableDefs("NameOfLinkedTable").Connect

The Connect string will contain the path to the database that this table
is supposed to be linked to.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
B

Bob Barrows [MVP]

Even for non-Access databases?

John said:
Open up the database and use the following in

CurrentDb().TableDefs("NameOfLinkedTable").Connect

The Connect string will contain the path to the database that this
table is supposed to be linked to.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Is there a way to list/display the source location/properties of an
ODBC link in an Access DB?

An Access MDB was backed-up before a computer was re-imaged
I'm trying to find information on the ODBC source location to
re-establish the links in the restored MDB so it will work

I got this great query from this discussion group to list regular
linked table souces in an access DB

SELECT [Name], Database, ForeignName
FROM MSysObjects
WHERE [Type]=6
ORDER BY [Name];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top