I have code in my Excel app (2010) that opens the app's back-end db file (.mdb). This allows me to look at tables, create temp. queries, etc. while I'm working with my Excel VBA. For some reason, if I open the file using this code, when I manually create a quick query in Access, Access forces me to save the query (only gives me SAVE or CANCEL buttons) before I close it or the DB file. I end up having all these trash queries in there I have to clean up later.

If I open the db file manually (using Access directly or MS Explorer), when I create a query I can close w/o saving it if I want.

QUESTION: Is there some setting I need to include in the code that opens the db file in "normal" mode so I can close w/o saving temp. queries, etc.? (Is there a better way to open a db file from Excel that doesn't result in a connection hanging on?)

Note: I am not running the Set = Nothing code at the end because I want the DB file to be open/available while I also work in Excel. Maybe that's the cause???

'(a) Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")

'(b) Open database in Microsoft Access window.
(final parameter is the Password)
appAccess.OpenCurrentDatabase gMDBName, , gStdPassword

'(c) Show Acess window
appAccess.visible = True

'If this code is enabled, the Access window never appears for user.
''''Set appAccess = Nothing