Can't open .MDB or access files on a mapped network drive

3k Views Asked by At

I'm having some trouble opening an .mdb (access 97) on a mapped network drive. The drive is OK and I can see it with net use

I can open the file fine if I open it using the path and not the network drive (\srv10\mdb).

I already tried creating the drive with different user (they all have permission) but it didn't helped.

This is happening also if I try to open it in code (let's say VB6)

Database path : P:\db.mdb doesn't work.
Database path : \\srv10\mdb\db.mdb works fine.

Can someone help me ? It used to work with a network drive and now suddenly it doesn't.

1

There are 1 best solutions below

1
On BEST ANSWER

This is due to the identity under which the code executes. You mapped the drive within your own user context but the actual user context under which the script or VB code runs is another (local machine?) where the same mapping is not present.

You can either

A possible difficulty you face in the scripting solution is how to provide the credentials - there is a good explanation of that in the SO answer to a similar question here.

The registry edit is explained at the link but the gist is:

Symptom: After you turn on User Account Control (UAC) in Windows Vista or Windows 7, programs may not be able to access some network locations. This problem may also occur when you use the command prompt to access a network location.

Cause: This problem occurs because UAC treats members of the Administrators group as standard users. Therefore, network shares that are mapped by logon scripts are shared with the standard user access token instead of with the full administrator access token.

Resolution: To work around this problem, configure the EnableLinkedConnections registry value. This value enables Windows Vista and Windows 7 to share network connections between the filtered access token and the full administrator access token for a member of the Administrators group. [A reg edit procedure is then given]

I realise this is not a perfect take-away answer but at the moment you do not provide enough detail to give one, so I hope this shows you a way forward.

[Edited for completeness after OP posted the reg edit solution].