FileSystemObject with Networked Drives

phatJ
06-11-2003, 08:00 AM
The scenario...
I am trying to write an ActiveX dll that will reside on an IIS machine. This component needs to access all of the files within 1 folder, "Reports", on a network pc. I have mapped the folder's parent folder to the "G:\" drive.

The Problem...
Using the FileSystemObject to access this folder and its contents fails everytime. It refuses to recognize the drive or folder. Then I tried to simply enumerate the drives on the webserver and it only returns the following drives: A(floppy), C(Hard Drive), D(CD-ROM), and E(CD-ROM).
This webserver has nearly a dozen mappen drives, none of which are recognized.

Is there some property or permissions that I need to set in order to recognize these network machines using FileSystemObject.

JordanChris
06-12-2003, 04:41 AM
FSO works happily to a mapped drive.

You say you mapped the drive.... but did you map the drive from the account that the webserver is running in?

You can use this to map a drive....

Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long

Private Sub Form_Load()
WNetAddConnection "\\vdk00005\proj", "", "H:"
End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum