Cosmos75
Registered User.
- Local time
- Today, 14:19
- Joined
- Apr 22, 2002
- Messages
- 1,281
I am using this query to pull data from the MSysObjects table;
SELECT MSysObjects.Database, MSysObjects.Connect, MSysObjects.ForeignName, IIf(IsNull([Connect]),"",Right(Left([Connect],Len([Connect])-1),Len([Connect])-(InStr(1,[Connect],"PWD=")+4))) AS connectPW, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=6))
ORDER BY MSysObjects.Database, MSysObjects.ForeignName;
MSysObjects.Database = File Name & Full File Path
MSysObjects.ForeignName = Linked Table Names (Type = 6)
connectPW = Password (if applicable)
Is there anything that I am overlooking with using the results of this query to relink tables? The one limitation that I can think of is that I will only be able to relink tables that have already been linked. I can use this to relink tables where the back-end folder/file has been moved or renamed. But then again, I am not 100% sure how the MSysObjects table is populated though it does seem to have everything I need.
I had thought about having 2 tables - one to store all the back-end file info (File Name, Path, Password) and another to store the names of all the linked tables. As I was poking around in the MSysObjects table I found all that stuff was already there for the tables that are already linked in the Front-End.
SELECT MSysObjects.Database, MSysObjects.Connect, MSysObjects.ForeignName, IIf(IsNull([Connect]),"",Right(Left([Connect],Len([Connect])-1),Len([Connect])-(InStr(1,[Connect],"PWD=")+4))) AS connectPW, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=6))
ORDER BY MSysObjects.Database, MSysObjects.ForeignName;
MSysObjects.Database = File Name & Full File Path
MSysObjects.ForeignName = Linked Table Names (Type = 6)
connectPW = Password (if applicable)
Is there anything that I am overlooking with using the results of this query to relink tables? The one limitation that I can think of is that I will only be able to relink tables that have already been linked. I can use this to relink tables where the back-end folder/file has been moved or renamed. But then again, I am not 100% sure how the MSysObjects table is populated though it does seem to have everything I need.
I had thought about having 2 tables - one to store all the back-end file info (File Name, Path, Password) and another to store the names of all the linked tables. As I was poking around in the MSysObjects table I found all that stuff was already there for the tables that are already linked in the Front-End.
Last edited: