Gustav Brock
Gustav at cactus.dk
Thu May 8 11:34:23 CDT 2008
Hi Roz Well, try! Done in 10 seconds if you fire this in the imm. window (replace d:\path with your actual drive\folder): Shell "subst h: d:\path" If you have an H: drive, it will not work. If it works, the H: drive is available right away. /gustav >>> rosalyn.clarke at barclays.com 08-05-2008 18:24 >>> Yup, impossible! This is something I'd never heard of & I'll try & squirrel away the info against future need. But I think that as JC says it won't work if H:\ is mapped to somewhere else? Thanks for the tip Roz -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 08 May 2008 12:37 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