A family of Microsoft relational database management systems designed for ease of use.
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!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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 :
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 :
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
A family of Microsoft relational database management systems designed for ease of use.
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.
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!
I'd suggest you open your own question for this, and give full details of your environment, and the symptoms of your issue.
Hi,
am facing this problem now on Access 2016, Win 10
driving me mad!
If someone has found the solution since, please help.
Saad.
Taanks for your message. Currently, this problem non longer exists and I don't know why or how suddenly it disapeared. Weird...
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.