It looks like I figured out the cause, and it only sort of had to do
with the security prompts. Apparently, the second connection was
occuring before update was completing in the access database. The only
reason it would work when clicking the prompts was it allowed an extra
second or so for the update to happen, then run the check to get the
next number. I somewhat adjusted for this by putting a timeout in the
code, which I dont really like, but even a delay of 500 milliseconds
makes it work.