Thank you for your patience with me, and thorough response. Below I post what I hope are all the relevant parts of the code, in addition to the earlier snippet.
I do not know for a fact that the computer is running (or ever did) run out of memory space. The application is on a remote computer, and I don't have regular access. Mainly I hear anecdotal notice that "something went wrong". It is never enough information to diagnose any particular fault.
The global object type variables "sh" and "strs" are declared in the DataCycle module.
The subroutine "DataCycle" runs every two seconds per the scheduler. This sub performs a variety of tasks, one of which is to trigger sub "WriteStatus" to update the "test_data.data_status" SQLS table.
As of now, the "sh" and "strs" objects are released in the "AutoClose" sub.
From your post #3 I think I understand that the code is OK as is, as VBA should release the earlier recordset object when the latest one is created. However, for sure it does no good to "Set strs = Nothing" as Excel is closing, and it will not do harm and may do good to include the "Set strs = Nothing" statement after the insert operation in the sub WriteStatus().
Bookmarks