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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to Comment Out Lines of Code in a Pass Through Query In MS Access 2016 19 54
vb.net 1 month apart 11 30
sql server service accounts 4 27
MailAddress in vb 4 15
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

809 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