Is a table linked?

XLEAccessGuru

XLEGuru
Local time
Today, 12:02
Joined
Nov 17, 2006
Messages
65
Does anyone know if there's a true/false property that can be returned if a table is linked? For example, I have a loop going through my AllTables and want it to do 'something' if the table is a linked one. I just need to know who to determine whether it's linked or not. Can't seem to locate this info in the VBA ref library.

Thanks to all of you who spend time answering these message boards! It truly is appreciated!!!

:D
 
It looks like this will get all linked table names:

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=6));


and this will get NON-linked table names:

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=1));
 
For linked tables, you might want to try:
SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE MSysObjects.Type IN (4, 6);


This will include attached ODBC tables as well.
 
YOu can use the SourceTableName property of the TableDef object. If Len(SourceTableName)>0 then it's a linked table.
 

Users who are viewing this thread

Back
Top Bottom