ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Access.Application.Quit - opens Access again then won't close - He (https://www.excelbanter.com/excel-programming/351785-access-application-quit-opens-access-again-then-wont-close-he.html)

Hluhluwe

Access.Application.Quit - opens Access again then won't close - He
 
I'm using Excel to get some data from a database query. But I need to update
the data first so I've created an Object (ObjAccess) then typed
Set ObjAccess = Access.Application
Run some code in Access, updated tables, checked data etc. etc.

My problem comes when I try to get it out of memory.

I use the line ObjAccess.CloseCurrentDatabase the database is still in
memory even after the Sub ends.

If I use ObjAccess.Quit it opens Access again and won't let me close it (I
have to go to Task Manager & use End Task.)
The same happens if I use Set ObjAccess = Nothing.

If I don't do anything, this database stays in memory (even after the Sub
has finished) and I can't modify any data in the database as I get the
message "You don't have exclusive access".

Is there something I'm missing??? Is there something I need to do in teh
setup of Excel and/or Access to get this to work?

Please help!!!


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com