Max Wanadoo
max.wanadoo at gmail.com
Thu May 8 06:50:56 CDT 2008
Gustav,
What a memory you have! In days gone by, I used this SUBST stuff a lot but
I have to say that it had gone completely out of memory until you mentioned
it here.
Great stuff! Hope it does the trick.
Roz: I wouldn't use a constant but a field in a table linked to a
maintenance form. That way if it changes you don't need access to the code.
Max
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Thursday, May 08, 2008 12:37 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Drive mappings & global constants
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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com