My dog-and-pony VBA program to get a store/restaurant name from my spreadsheet and look up its town & state in a little Access database is coming together; I made some now-corrected flow control errors that had the lines
Set dbconnect = New ADODB.Connection
dbconnect.Open conn_str
executing more than once, without a dbconnect.Close occurring anywhere. Assuming that that's the reason for the error '-2147467259 (80004005)' (The table 'DevTableReal' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically), I tried executing a single sub with the line "dbconnect.Close" and was unsurprised to see this sub fail since dbconnect wasn't, at execution time, considered a valid object. Yet the ADODB connection, that "dbconnect" had been a handle for in the program's previous run, was apparently still out there.
Is there a way for a VBA program to look for & get a handle on an existing ADODB connection that is open - was opened, initialized, referenced - before said VBA program's run-time?
(Rebooting the machine (after fixing the code :D ) got rid of the connection, but I sooooo suspect there was a cooler way to do it.)