Err 3045 : Impossible to use «namedDB». File in use. (Access2010/win8-64)

Anonymous
2013-02-19T11:04:23+00:00

Hello,

I hope you can find some time to look at my serious msAccess & VBA problem : my last projects are totally blocked with an error 3045 raised when the Sub related to a button in a simple form executes the statement :

    Set MyDB = CurrentDb

The error message is "Impossible to use «namedDB». File in use."

Here's the minimum of code raising this error :

Private Sub cmdMini_Click()

'==========================

Dim MyDB As Database

    On Error GoTo GestionErreurs

Stop

    Set MyDB = CurrentDb    ' <=== <=== <=== ERRREUR !

    Set MyDB = Nothing

ExitHere:

    Exit Sub

GestionErreurs:

    GestionErreur Err.Number, "cmdMini_Click"

    Resume ExitHere

End Sub

I must write, that after several days of searches on French or English speaking Web sites, the only workaround that allowed me to continue developing this NPO project, was to restart my 2006 PC with WinXP & Access 2003 : no error there (but I guess it will come back when I'll have to necessarily go back to Access 2012 / Win 8). And the development environment and performances are a real penalty. Here follow explanations.

Using msAccess 2010 with Windows 8 Pro 64 bits in french on my own PC (no network, no server, no virtualization, etc), my project, as a retired person and volunteer collaborating with an NGO, is about volunteers and sites registrations for Open Days and processing WORD protected documents to extract data and store them in the DB in order to allow visitors to select which sites to visit. I have no problem analyzing the Word documents and extracting the data. I got the error only as soon as I had to open the DB and its tables to store the data.

I have compacted and repaired the DB, used the Decompile option, checked the permissions on the DB file :

  • MINI.MDB : free access, checkbox "Read-only" is not checked ; in "Advanced attributes", 2 checkboxes are checked : "File ready to be archived" et "Allow content indexation..."
  • folder "ProjetMSA" : checkbox "Read-only (applies only to files in the folder)" is in an intermediate state (small black square inside the checkbox) between not checked (white checkbox) and checked (white checkbox with the classical black V). I unchecked the checkbox and the one of the parent folder "po2013", giving a message with only 1 checkbox  "Applies changes to the folder, subfolders and files" (without access to the other checkbox), only one choice, click on [OK].
  • disk root D: 97,6 Go with 14,6 in use ; set as "Shared" evenb if it's not significant in my case, but who knows ? "Authentified Users", "Users", "Administrators" et "System" got Toatl Control. Diffcult to havec more open ? Quota management is not active.

Execution : same error and the checkbox "Read-only" for the folder "ProjetMSA" is again in its intermediate state "à l'insu de mon plein gré" ; on a Microsoft web site, I read that this settings has no impact on file usage.

I have recreated a new DB and imported all objects of my NGO project. No way. And this happens both in .MDB and .ACCDB ms Access dbs.

VBA references are :

  • Visual Basic for Applications
  • Microsoft Access 14.0 Object Library
  • Ole Automation
  • Microsoft Office 14.0 Access database engine Object Library
  • Microsoft Scripting Runtime
  • Microsoft Word 14.0 Object Library

The last 2 are required to process the Word .docs. I have modified the libraries sequence but without success.

I tried alternate statement to open the DB with the same error :

    Set MyDB = OpenDatabase(CheminNomDB, False)

    Set MyDB = DBEngine(0)(0)

I read on a web site that one of the following statements could solve the problem :

    RefreshDatabaseWindow

    DBEngine.Idle dbRefreshCache

The first is ok but the error 3045 with the Set statement is still raised. The second raises this error by itself.

February 16, instead of using my full project DB, I created a new MINI.MDB in my disk root D:, with 1 table with only 1 keyfield, with 1 sourceless form with 1 button executing the code above. This executed correctly in the root but as soon as I moved the DB to my project workfolder "D:\po2013\ProjetMSA", opened and activated it (because of Win8 protection on moved files), opened the form and clicked on the button, an error 3045 was raised :-(((

I also added the folder and MINI.MDB to the "Trusted Locations" : nothin better.

At least but only once, I was successful in eliminating the error but for a couple of hours only, by renaming the subfolder where resides my DB from "DB" to "ProjetMSA". Then it came back...

Setting MSACCES.EXE in Win7 compatibility mode and/or Run as administrator : nothing helps.

No other Access application is running; after 40 years as an IT professional, I have a dozen of personal MSA applications running without this error. Only the recent new projects in development raise this error.

As soon as this NPO development is done on my 2006 PC with WinXP/Access 2003, I'll investigate LibreOffice (or FreeOffice) : additionally it's free of charge, not like Office : so much Euros and years of practice and expertise to be thrown away...

Thank you for your attention.

Michel

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2016-02-12T22:51:19+00:00

    I think I found the solution!

    CurrentDb must be positioned before any "OpenDatabase" Method on your code in the form!

    thenso far am having no problems!

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-02-12T22:51:05+00:00

    I'd suggest you open your own question for this, and give full details of your environment, and the symptoms of your issue.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-02-12T22:36:35+00:00

    Hi,

    am facing this problem now on Access 2016, Win 10

    driving me mad!

    If someone has found the solution since, please help.

    Saad.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-09-07T14:18:14+00:00

    Taanks for your message. Currently, this problem non longer exists and I don't know why or how suddenly it disapeared. Weird...

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-09-06T00:45:13+00:00

    Did you ever find a solution for this? I have the same issues, but not all the time. It seems to come and go as it pleases.

    Was this answer helpful?

    0 comments No comments