DAO Opendatabase method and UNC paths (1 Viewer)

joefer

New member
Local time
Today, 18:43
Joined
May 7, 2016
Messages
2
Hi everyone! :)

Today I have faced a weird behaviour while trying to use the DAO opendatabase method with a UNC path pointing to an external database.

Using the opendatabase method to open a database in exclusive mode fails when using a UNC path, as it opens the database not as exclusive, but read-only mode.

VBA code: Set dbx = opendatabase("\\server\shareName\dbname", True)

When using local paths this method works, opening the database as exclusive (not read-only)

VBA code: Set dbx = opendatabase("X:\dbname", True)

Anyone has faced this behaviour before? Am I doing something wrong?

Thanks in advance for your help!! ;)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:43
Joined
Feb 28, 2001
Messages
27,328
I'm not going to swear on a stack of Bibles for this one, but...

In order to map a drive to letter X: you need credentials and will essentially log in to the server hosting the drive. The permissions in that case will depend on factors related to group membership and the fact that you presented credentials.

If you use the UNC path, you do not present credentials. You are thus depending on the SHARE permissions of the database file and if you don't have MODIFY equivalent via the SHARE, you can't open the database in any other mode than read-only. In particular, your bug-a-boo is the .LDB file or equivalent, which ONLY will work correctly if you have MODIFY access to the folder. You can overcome this simply enough, but it means that you must have permissions associated with the SHARE folder for your account (or a group of which you are a member) that don't require presentation of credentials to the drive host. In a domain-based environment, your domain admin can easily set this up if given the go-ahead by management. Of course, for smaller environments, your domain admin probably IS your management.
 

Users who are viewing this thread

Top Bottom