Error 75 path/file access error 
Author Message
 Error 75 path/file access error

I've written a couple of  NT services using VB 6 (SVPack 5) (using the
NTSVC.OCX). Both work fine, however, one of them displays a weird behaviour:

- Both run on an NT 4 server with service pack 6a
- both programs run under the same NT Account, with Administrator rights
(member of the Global Administrator group).
- both access the same shared directory on the network.
- both read/write files to that shared directory. However, one of them when
it attempts to write (create) a file to anywhere on that share it fails with
error 75. The other program works fine!. The code portion is textually the

There is only one difference, on the program where the error occurs:

- It maps a drive letter to that share using WNetAddConnection2 as follows:

'so it uses the current user credentials
szUser = Chr$(0)
PasswordText = Chr$(0)

szServer = "\\servername\share\dir"
szLetter = "X:"

With NR
        .dwType = RESOURCETYPE_DISK
        .dwScope = RESOURCE_GLOBALNET
        .lpProvider = Chr$(0)
        .lpComment = Chr$(0)
        .lpRemoteName = szServer
        .lpLocalName = szLetter
    End With

    ' Enter the following two lines as one, single line:
    Succeed = WNetAddConnection2(NR, PasswordText, szUser, 0&)

This succeeds (Succeed is 0)

However the attempt to write to that share is not thru the mapped drive, but
thru the UNC path, as follows:


On Error Resume Next

    x = OpenFile(szFlag, buffer, OF_EXIST)      'check if a file
exists(attempt open and close)
    If Not (x = HFILE_ERROR) Then Exit Function 'file exists

On Error GoTo SetFlagError

    hFile = FreeFile()
    Open szFlag For Output Access Write Lock Write As hFile  'Lock Write
    Print #hFile, gszHostComputerName & ":HC00218"

---> Fails with Error 75

(note above code is the same for both programs [one works the other
oesn't]  )


If run through the IDE it works fine (I'm a Domain Administrator...).
Also if the service is started and the drive mentionned above is mapped
while the user (whose account is used for the service) is logged on to the
desktop, No error occurs, and all works fine.

It's as if there's some sort of corruption on the use of the user
credentials when a drive is mapped...?



Tony Pinto

Fri, 21 Nov 2003 15:55:15 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Error 75 (Path/File access error) ???

2. Error 75 Path/File access error

3. Error 75: File/Path Access Error

4. Path/File access error (Error 75)

5. Error 75: File/Path Access Error

6. Error 75 'Path/File access error'

7. Error 75 'Path/File access error'

8. Path/File access error (Error 75)

9. Error 75: File/Path Access Error

10. RT 75: Path/File access error?

11. FileCopy returns path/file access error 75.

12. Path/File Access Error 75


Powered by phpBB® Forum Software