How to create Link table when MDB is created

SirDrums

Registered User.
Local time
Today, 15:11
Joined
Jul 15, 2009
Messages
83
Hey guys, I was wonder if the following is possible:

1. Monitor a certain folder on C drive.
2. Look for a certain MDB to be created.
3. When the MDB is found create a link table in it.

The reason i need this is because we use a application that creates a local mdb. In this local mdb i need another link table created to use in a query. When the application closes it deletes the local mdb.


Thanks
 
1. Monitor a certain folder on C drive.
2. Look for a certain MDB to be created.

I will make a general suggestion on these points...

I get the impression from the way you worded these points that two separate computers will be involved, correct? If so, then I would from the computer writing the file, have that process save it as a different filename than the monitor process will be searching for. once successfully saved, THEN quick rename the file so that the monitoring process will see the new file.

If the monitor process saw a file still being written to disk, and tried to open the file... BANG!!! :banghead: Just within your naming standard, perhaps have a static portion for files being written, another static portion for files completely written. and to those two prefixes append some random string which would be the same random between temp/perm prefixes. Yes do the save as the temp filename to the production directory... just swap the names and do not move/copy the file again.

3. When the MDB is found create a link table in it.

There are good resources to be found about automating the updating of Linked Table Objects, so I will not speak to this point.
 
mdluek is correct. You need to be careful to not "see" the file before it is actually complete.

The actual link can be done with the TransferDatabase method.
 
I will make a general suggestion on these points...

I get the impression from the way you worded these points that two separate computers will be involved, correct?

Two plus computers are involved but they all create there own version of the mdb on theri C drives when the app is launched.

THe app i would like to write would have to sit on everyones machine individually.
 

Users who are viewing this thread

Back
Top Bottom