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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Article by: btan
Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now