You could look at the properties in the linked table with a routine something like.
Function catalogTC()
'-- set reference to ADOX library
'- Microsoft ADO Ext. 2.6 for DDL and Security
'-- Microsoft ActiveX data objects 2.6 library also needed for ADO
Dim cg As New ADOX.Catalog
Dim tb As New ADOX.Table
Dim cn As ADODB.Connection
Dim cl As Column
Dim pp As ADOX.Property
Set cg.ActiveConnection = CurrentProject.Connection
For Each tb In cg.Tables
If tb.Type = "PASS-THROUGH" Then
Debug.Print "table name = "; "-------"; tb.Name; "--------"; tb.Type
For Each pp In tb.Properties
Debug.Print "property name = "; pp.Name
Debug.Print "property value = "; pp.Value
Next
End If
Next
Right... I did find that. But I'm having trouble displaying with some of the linked tables. I have a group of them that belong to the same database. The problem that I run into is that only some of them have the property that displays the name of the database they belong to. The others do not. Is there another way to identify a link tables corresponding database?
Are all of the tables sql server linked tables, or are some linked to another database type such as Access. If so, the types and property names will be different.
Not all the tables are sql server linked tables. That is the problem I'm running into. Is there a method I can use to get me the name of the SQL linked table's database?
In my example, I showed the type for sql server linked tables. Access linked tables would be a different type.
tb.Type = "PASS-THROUGH" '- for sql server tables.
tb.Type = "LINK" '- for Access tables.
As Jerry Klmns pointed out the msysobjects table should have all the information also. This is a hidden table in Access, so to view, go under options and select the check mark for hidden objects.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.