Solved

Microsoft Office Access can't open the database because it is missing, or opened exclusively by another user

Posted on 2010-08-17
3
880 Views
Last Modified: 2013-11-27
I get this error when I try to open an access database and run a macro from vb.net: "Microsoft Office Access can't open the database because it is missing, or opened exclusively by another user."

I have searched high and low for a solution.  It went away for a few times, now it is back and I have no idea why.  My research tells me it might be a security issue on the server, though I get the error whether I run it on a local datbase or a network database.  Any ideas?
RunPickAccessMacro ("test")
Private Sub RunPickAccessMacro(ByVal sMacro As String)
        Dim oAccess As Access.ApplicationClass
        Try
            oAccess = CreateObject("Access.Application")
            oAccess.Visible = True
            oAccess.UserControl = True
            oAccess.AutomationSecurity = 1
            'oAccess.OpenCurrentDatabase("\\mwwnas1\mwwnas1f\mis\Projects_Prod\PickTick\pickticket97_test2.mdb;", False, False)
            oAccess.OpenCurrentDatabase("c:\test.mdb;", False, False)
            oAccess.DoCmd.RunMacro(sMacro)

            'Clean-up: Quit Access without saving changes to the database.
            oAccess.DoCmd().Quit(Access.AcQuitOption.acQuitSaveNone)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess)
            oAccess = Nothing


        Catch ex As Exception
            sErrNo = Err.Number.ToString
            sError = "**Macro" & vbCrLf & Err.Description & " " & "ErrNo: " & sErrNo
            dispError(sError)
        End Try
    End Sub

Open in new window

0
Comment
Question by:Delta7428
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
uscshaggy earned 300 total points
ID: 33456209
I would suggest downloading Process Explorer from MS/sysinternals, http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx which you can use to see which process(es) have a handle open for a particular file.  When you encounter this error again, run ProcessExplorer.exe and use Ctrl+F to search for your database name (test.mdb). It should find the process that is currently accessing the file.  I would guess it is an AV product, but this will show you for sure.  

Once you identify the process that is has the file open, shut that other process down, or put in exclusions for your database if it is an AV or HIPS product.
0
 
LVL 6

Assisted Solution

by:rbgCODE
rbgCODE earned 200 total points
ID: 33458139
Have you tried opening the database passively instead of with strict permissions?  
0
 

Author Comment

by:Delta7428
ID: 33458164
yes, I added permissions hoping it might help.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question