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
879 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
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Customized VNC 1 36
Signature required on a report 5 26
Window update errors on VMs 9 20
Code enhancement 4 20
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The next five years are sure to bring developments that are just astonishing, and we will continue to try to find the balance between connectivity and security. Here are five major technological developments from the last five years and some predict…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

792 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