0

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
SilentRage47
  • 934
  • 2
  • 14
  • 31
  • why not using the ODBC connection ? – Beldi Anouar Jan 02 '17 at 14:10
  • What is the exact error you encounter? Can you open the file by pasting the UNC path into Access itself? – Alex K. Jan 02 '17 at 14:32
  • I get a "Can't find file ...*path*" every time I try to open it from a mapped driver. No problem when I open it using the complete path(\\srv10\...) both on Windows10 and VB6. – SilentRage47 Jan 02 '17 at 14:41
  • Possible duplicate of [VB6 Application on Windows 7 Cannot Access Mapped Drives](http://stackoverflow.com/questions/8812879/vb6-application-on-windows-7-cannot-access-mapped-drives) – C-Pound Guru Jan 02 '17 at 21:51
  • Try running the VB6 with "Run as administrator" option and then debug the code to check if still you get the error. – Mukul Varshney Jan 03 '17 at 03:51

1 Answers1

4

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].

Community
  • 1
  • 1
Vanquished Wombat
  • 9,075
  • 5
  • 28
  • 67
  • Don't use that registry hack though. Better to map the drive letter for every profile that needs it or use the UNC path. – Bob77 Jan 06 '17 at 09:59