Recordset.Open returns Empty Recordset but shouldn't be

  • Having a weird issue on this project. Never seen it before in Excel


    I have some automation that runs over night. The automation works fine at first but at some point at night, the recordset.Open calls are returning emtpy record sets even though they shouldn't be.


    I can take the exact same sql string and run it in SQL Management Studio and it returns a result.


    I debugged and the connection looks valid, but the recordset is definitely empty.


    To fix it, I just need to Terminate the project by pressing the Stop button in the VBA environment. I start it up and it now works fine again.


    I verified that I am opening, using and then closing both the recordset and the connection, but not sure if I have memory leak or something else.


    I can add some error trapping to detect the empty recordset, but not sure how to get the system to auto recover when it gets in this state.


    Any suggestions.


    using rst.open GetMatch @Status='Update', @SendType=Automatic in a call to SQLServer


    Thanks in advance for any help .