Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I have problems with closing an Access DB. Here's the code I have.
When I run it, the focus from Excel VBE disappears and when I try to open manually the database after running the program, I only get a new file, tempDB0.laccdb and the DB doesn't open. If I explicitly press stop from Excel VBE, I can open the file however.
I'm pretty sure I miss some command here, but what command?
Code:
Sub TestClosing()
Dim acdb As DAO.Database
Set acdb = DBEngine.OpenDatabase("C:\tempDB0.accdb")
acdb.Close
End Sub
When I run it, the focus from Excel VBE disappears and when I try to open manually the database after running the program, I only get a new file, tempDB0.laccdb and the DB doesn't open. If I explicitly press stop from Excel VBE, I can open the file however.
I'm pretty sure I miss some command here, but what command?