G
George
In retrospect, I should have asked first.
I wrote a function in VBA to which one passes a desired
share path. If the share is not yet mapped, the function
identifies the next available network drive letter and
maps the share to that drive; the function returns the
drive letter of the mapped share.
Here's the issue:
I did not know how to actually map the drive in VBA
Access, so I wrote a little WSH script (see below).
How should I have done it in Access?
Thanks for your help
George
'--------
Set WshNetwork = WScript.CreateObject("WScript.Network")
strArguments = wscript.Arguments.Item(0)
intComma = Instr(strArguments, ",")
strDriveLetter = Left(strArguments,intComma-1)
strShare = Trim(Mid(strArguments, intComma+1,Len
(strArguments)-intComma))
WshNetwork.MapNetworkDrive strDriveLetter, strShare
'--------
I wrote a function in VBA to which one passes a desired
share path. If the share is not yet mapped, the function
identifies the next available network drive letter and
maps the share to that drive; the function returns the
drive letter of the mapped share.
Here's the issue:
I did not know how to actually map the drive in VBA
Access, so I wrote a little WSH script (see below).
How should I have done it in Access?
Thanks for your help
George
'--------
Set WshNetwork = WScript.CreateObject("WScript.Network")
strArguments = wscript.Arguments.Item(0)
intComma = Instr(strArguments, ",")
strDriveLetter = Left(strArguments,intComma-1)
strShare = Trim(Mid(strArguments, intComma+1,Len
(strArguments)-intComma))
WshNetwork.MapNetworkDrive strDriveLetter, strShare
'--------