Linking tables that don't exist

AlanJ10

Registered User.
Local time
Today, 23:44
Joined
Feb 20, 2007
Messages
38
Is there anyway I can create a linked table to a database that "doesn't exist" (ie. is on a network that I don't currently have access to, but the users will have access to)?
At the moment, I'm working around it by having the database check the links on startup, so when the user opens it up they get prompted for a backend (if it's different to where I was expecting it to be) and everything gets relinked, but I'd rather do it without any user interaction (or delays while everything gets relinked in the background). Is it possible?
 
if you get a table, and read the tdf.connect property, it will include a path

(for a jet database the string is ;database=path)

for a "suspect table", you can examine this string, and then see if the path exists - if it does the database is connected, and then you dont need to reconnect.


------------
i thought you would be familiar with tabledef's collection, if you are relinking in code, but if not

currentdb.tabledefs("sometable").connect is the same thing
 
if you get a table, and read the tdf.connect property, it will include a path

(for a jet database the string is ;database=path)

for a "suspect table", you can examine this string, and then see if the path exists - if it does the database is connected, and then you dont need to reconnect.


------------
i thought you would be familiar with tabledef's collection, if you are relinking in code, but if not

currentdb.tabledefs("sometable").connect is the same thing

Thanks for that. Is there anyway I can set the connect property to have a path that doesn't exist (I haven't actually tried this for a bit, but I think refreshlinks either doesn't do anything, or gives an error, I don't remember).

It looks like the best way is to just put something in so that the links will be refreshed if they aren't linked correctly.
 
If you use a mapped drive as the path you can map a folder on your computer as a substitute when the network drive is unavailable.
 

Users who are viewing this thread

Back
Top Bottom