Linked Table Manager not showing full path - Access 2000 & 97

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've had this problem awhile and haven't found an answer

I have multiple linked databases and most are several folders deep. The problem is I can only see part of the path and can't see the portion that says which specific database a table is linked to.

I get something like "table(s:\folder\subfolder" before it runs out of space. Is there a way to see the full path by resizing the dialog box or any other way? Your help is appreciated.
 
No, it's just a poor design.

You can look at the Connect property of the TableDef object if you have a
reference set to DAO:

Sub ListLinkedTablesUsingDAO(WhatDatabase As String)



Dim dbCurr As DAO.Database

Dim tblCurr As DAO.TableDef

Dim strOutput As String

Dim strSource As String



If Len(Dir$(WhatDatabase)) > 0 Then

Set dbCurr = OpenDatabase(WhatDatabase)

For Each tblCurr In dbCurr.TableDefs

If Len(tblCurr.Connect) > 0 Then

strOutput = tblCurr.Name & _

" linked to table " & _

tblCurr.SourceTableName & _

" in database " & tblCurr.Connect

Debug.Print strOutput

End If

Next tblCurr

dbCurr.Close

Set dbCurr = Nothing

End If



End Sub



You can query the (normally hidden) system catalog:



SELECT Name, Database, Connect, ForeignName

FROM MSysObjects

WHERE Type = 6

ORDER BY Name



You can query the ADOX Catalog:



Sub ListLinkedTablesUsingADOX(WhatDatabase As String)



Dim catCurr As ADOX.Catalog

Dim tblCurr As ADOX.Table

Dim prpCurr As ADOX.Property

Dim strOutput As String

Dim strSource As String



Const saLinkDS = "Jet OLEDB:Link Datasource"

Const saLinkPS = "Jet OLEDB:Link Provider String"

Const saRemTbl = "Jet OLEDB:Remote Table Name"



If Len(Dir$(WhatDatabase)) > 0 Then

Set catCurr = New ADOX.Catalog

catCurr.ActiveConnection = _

"Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=" & WhatDatabase & _

";User Id=Admin;Password="



For Each tblCurr In catCurr.Tables

If tblCurr.Type = "LINK" Or _

tblCurr.Type = "PASS-THROUGH" Then

strSource = tblCurr.Properties(saLinkDS)

If Len(strSource) = 0 Then

strSource = tblCurr.Properties(saLinkPS)

End If

strOutput = tblCurr.Name & _

" linked to table " & _

tblCurr.Properties(saRemTbl) & _

" in database " & strSource

Debug.Print strOutput

End If

Next tblCurr

Set catCurr = Nothing

End If



End Sub




--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Primitive said:
I've had this problem awhile and haven't found an answer.

I have multiple linked databases and most are several folders deep. The
problem is I can only see part of the path and can't see the portion that
says which specific database a table is linked to.
I get something like "table(s:\folder\subfolder" before it runs out of
space. Is there a way to see the full path by resizing the dialog box or
any other way? Your help is appreciated.
 
Another option is to open the linked table in design view, and look at the
properties of the table - you can widen the properties dialog to see the
full path.

Another trick I learned was that you can delete the description property (it
won't really delete), and then you'll see the connection as the description
in detailed view of the database window.

--
Joan Wild
Microsoft Access MVP

Primitive said:
I've had this problem awhile and haven't found an answer.

I have multiple linked databases and most are several folders deep. The
problem is I can only see part of the path and can't see the portion that
says which specific database a table is linked to.
I get something like "table(s:\folder\subfolder" before it runs out of
space. Is there a way to see the full path by resizing the dialog box or
any other way? Your help is appreciated.
 
Back
Top