without seeing the code and the parameters being passed, I can only guess why it fails with another db open except to speculate that there is a lock on a record or table that prevents a value from being returned.
Watch out for trailing spaces being passed to the Command function. I have experienced a specific (at least a minimum) string of characters may be passed and can exceed your cmd string. I passed "Otto Mayshun" (my attempt at some programming humor) and the function received "Otto Mayshun " thus the test for "Otto Mayshun" failed until I used the Trim function.
Maybe there is an easier way to do what you're doing, which appears to be forcing FE updates. Shouldn't each user have 1 shortcut for each FE application which checks for a version number in the BE tables and let that be the determining factor?
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.