home

Linked Table Manager Solution, SubSt Method

Thursday, May 09, 2002 12:47:38

Also check out the AutoRefresh Method

Common scenario: you have a database split into a "front-end" and "back-end." The path to the back-end table file on your machine while working on it is, say, C:\Databases\tooling. The path once it's copied to the end-user machine is, say, H:\SHARED EVERYONE\Data Bases\tooling. So, everytime you copy the file(s) from the development machine to the end-user machine, this path has to be updated or else a fatal error message occrs. Commonly, the end-user doesn't know how to refresh the links, or maybe it's a "secured" database and thus they don't have proper permissions. Or maybe you simply don't want them fooling around with such a feature.

One solution is to use the MSDOS command SubSt. This command allows you to remap a folder in your hard drive to its own distinct drive letter. So, as a result, your filepath will match the filepath of the enduser, preventing the need for the enduser (or you) to refresh these links--or come up with complex code to handle it. This command is typed at the C prompt, or a BAT file can be created which you can double-click to execute the command.

These command does NOT move the files/folders nor does it repartition the hard drive, nor does it create extra copies of the file/folders. It merely maps a certain path you've already created and treats it as a separate "hard drive." Also, when you reboot, it resets back to normal defaults.

If the original path is C:\databases\97\applied_image\fran_mccarty\tooling and you wish to make the path H:\, the syntax would be:

subst h: c:\databases\97\applied_image\fran_mccarty\tooling

In my case, I wanted the path to be H:\SHARED EVERYONE\Data Bases\tooling. To do this, I had to add those folders to the actual c drive and move the files to that folder. The command would remain the same, it's just that the actual "root" path (true location) of the files would become:

C:\databases\97\applied_image\fran_mccarty\tooling\SHARED EVERYONE\Data Bases\tooling

Prefix: Creating a BAT File

Creating a BAT file allows the user to execute common MS-DOS type commands by double-clicking a regular Windows icon, rather than having to go to the C prompt, typeout the command manually, and exit the C prompt.

The steps:

  • Open a text editor such as Windows Notepad
  • Type in the command
  • Save the file as a BAT file