Are you saving the query when you modify the connection string? That is the problem, then anyone can open the database and run the queries unless you change them back.
I am 99.9% certain that if you save a query def and give it no name, it only exists as long as the procedure is running or at worst, until the db closes. It would not rely on code to be destroyed. It cannot be seen in the nav pane. Thought that might help for next time.
Set qdef = db.CreateQueryDef("", svSql)
Last edited by Micron; 11-08-2016 at 08:45 AM.
Reason: Speling
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.