Is there a way in VBA to delete a database? I am writing a script to back up a database, make a .MDE file, and then I want to delete the temporary .MDB... I could write a batch file to do this, but I would prefer to keep all the code in one file.
I wish mine would work like a charm. I have created a temporary database to do some work in for a form. When the form closes I receiving a Runtime Error 75: File/Path Access Error.
I've been over the code many times and cannot figure out what is causing the error. The filepath is fine, I think access is the problem. Like I have some object open that is stopping the command from being executed. In the OnClose I am performing the following:
1) Removing the temp db's tables from listbox RowSources
2) Closing the recordsets to the temp db
3) Closing the temp db
4) Refreshing current db's tabledefs
5) Setting temp db recordsets to nothing
6) Setting the temp db to nothing
7) deleting links to temp db in current db
and finally failing at Killing the temp db
This is driving me crazy. I have been following the logic of Tony Toews, Granite Consulting and his demo dB works flawlessly. I have been over it 20 times now. Does anyone have any thoughts to share?
Regards, Sorrells
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.