Unable to Open File (1 Viewer)

kirkm

Registered User.
Local time
Today, 23:22
Joined
Oct 30, 2008
Messages
1,257
I'm trying to open an Access table from Excel and being told
Run-time error '3051':
The Microsoft Jet database engine cannot open the file
'Q:\CDList98K_BE - Copy.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.


Q: is a mapped drive which I can open/see in Explorer okay.
It is not already opened so it must be a permission problem?
How might I resolve this please ?

Code:
Function MyCDList() As DAO.Database
    Set MyCDList = DAO.OpenDatabase("Q:\CDList98K_BE - Copy.mdb")
End Function
Function GetCDListData(Cat) As DAO.Recordset
    Dim sql As String
    sql = "Select * From CDTracks Where TCat = " & Cat & ";"
    With MyCDList.CreateQueryDef("", sql)
        Set GetCDListData = .OpenRecordset
        .Close
    End With
End Function
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:22
Joined
May 7, 2009
Messages
19,169
DAO.OpenDatabase("Q:\CDList98K_BE - Copy.mdb", False, False)
 

kirkm

Registered User.
Local time
Today, 23:22
Joined
Oct 30, 2008
Messages
1,257
That didn't make any difference Arne., but if I move the mdb from the Mapped to local drive it's okay.
Also found opening it (or any) databases in Q: with Access brings up a warning "This database has been Opened read only..."
For the recordset read only is ok but I wonder what is setting them to read-only.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:22
Joined
Feb 28, 2001
Messages
26,996
if I move the mdb from the Mapped to local drive it's okay.
First, with the file in the Mapped drive, right-click on it, select Properties >> Security and look for "Effective Permission." Take notes.
Now, with the file in the local drive, do the same thing. Take notes.
Also, find the folder in the mapped drive where that file was being used. Again, determine effective permissions. Take notes.
Finally, find the local folder you were use, determine effective permissions, take notes.

Odds are extremely high that you will have full control on the file and folder in the local drive.
I'll give good odds that the permissions for the mapped drive will be a LOT more restrictive.

What you describe COULD be very easily caused by having insufficient permission to open the .LDB file in the shared folder. If you don't have at least MODIFY permission on that folder and on the Access file itself, you are running with permissions that are too restrictive for what you are trying to do.
 

kirkm

Registered User.
Local time
Today, 23:22
Joined
Oct 30, 2008
Messages
1,257
Thank Doc_Man, permissions were wrong (actually the share name was wrong to) so all sorted now.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:22
Joined
Feb 28, 2001
Messages
26,996
Yep, that's what it sounded like. Glad I could point you the right way.
 

Users who are viewing this thread

Top Bottom