[AccessD] Drive mappings & global constants

Gustav Brock Gustav at cactus.dk
Thu May 8 06:36:43 CDT 2008


Hi Roz

Seems impossible to carry out over night ... 

But an interim solution could be to use the forgotten gem SUBST, a DOS command to virtualize a drive letter.
Call it from VBA like this:

  Call CreateVirtualDriveH

given you create the sub:

  Public Sub CreateVirtualDriveH()
    ' Specify new path which holds stuff of previous drive H:.
    Const cstrNewPath As String = "s:\"
    Shell "subst h: " & cstrNewPath & "", vbHide
  End Sub

/gustav

>>> rosalyn.clarke at barclays.com 08-05-2008 12:56 >>>
Dear List

I have just been asked to resolve something, in zero time as usual, and I'm
sure there should be an elegant solution I just can't think of it.

There is a team that has 100+ Access databases, Excel spreadsheets and Word
templates that contain dependencies on a particular network drive that is
currently mapped to 'h:\'. In a few weeks time they will no longer be able to
use 'h:\' and will be given a new drive mapping. At some point shortly after
that, the server will be changed too, so the current DNS path will no longer
be valid either.

I don't know -and nobody will say for definite - what the new mapping & new
DNS path will be. These files are critical and the business insists on no
more than 24 hours downtime.

The dependencies include import/export routines, linked tables & linked
files.

What I would like to do is run a giant F&R on the code modules and replace
the root drives with a constant, and then make the constant available so that
ALL the applications use the constant. Then they can muck about with drive
mappings etc. to their heart's content and I won't have to come back to the
South coast and stay up all night changing code.

Any tips or ideas for making this work? Is it possible? I have code for
updating the code modules that should almost work but I've no idea how to
expose a constant across multiple apps.

TIA

Roz






More information about the AccessD mailing list