空白访问实例在返回logging集后仍然存在

我正在使用Excel打开一个访问实例并返回一个logging集。 不知道为什么,但在代码执行Access的空白实例后打开。 如果不打开任务pipe理器,我甚至无法closures它。

实际的方法比这个稍微复杂一些,但为了简单起见,这里是我在Excel中的代码:

Private Function t() Dim ac As Access.Application Set ac = New Access.Application Dim rs As DAO.recordSet ac.OpenCurrentDatabase (dataLocation) Set rs = ac.Run("Test2") If Not rs Is Nothing Then Call writeRecordSet(rs, sht, 1, 1) End If rs.Close Set rs = Nothing ac.CloseCurrentDatabase ac.Quit Set ac = Nothing End Function 

访问代码:

 Public Function test2() As DAO.Recordset Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("SELECT * FROM tbl_Aero_Units") Set test2 = rs End Function 

我认为这与logging集对象没有被closures有关,因为它只发生在我写入Excel工作表时。 任何人都知道为什么会发生这种情况,我怎么能阻止它呢?

更新:function完成后,我可以点击重置button,并closures访问的实例。