I apologize if this is not the right forum for VB6 so please send me to the right place if necessary.
I am using an ADO data control to access an MS Access 2000 database. I must use a server-side cursor to use pessimistic locking due to multi-users. I am opening an ADO recordset and assigning it to the ADO data control's recordset property in order to reuse the connection. The ADO data controls's recordset filter property is being set to limit the records returned to a specific account. All works fine until the Access .ldb file is not closed. I am closing everything I can think of but when the form is unloaded, the .ldb file persists. I can set the recordset.filter property the first time and still exit and the .ldb file is released. But if I loop around and reset the filter property to a different account, the .ldb is no longer released.
In form_activate event:
Set cn = New adodb.Connection
With cn
.Provider = "Microsoft.JET.OLEDB.4.0"
.Properties("Data Source") = DPATH$ + DBName$
.Properties("Jet OLEDB

atabase Locking Mode") = 1 'row-level locking
Screen.MousePointer = vbHourglass
.Open
End With
Set SOrs = New adodb.Recordset
mySQL = "Select * from ORDERS order by Acctnum, ODATE"
SOrs.Open mySQL, cn, adOpenDynamic, adLockPessimistic, adCmdText '
Set AdodcSO.Recordset = SOrs
adodcso.refresh
...
A different ADO data control is used to navigate through the customer accounts. There is a bound label control on the form to react to a change in the account#.
In the label's _Change event:
AdodcSO.Recordset.Filter = ("AcctNum = '" & lblAcctnum(1).Caption & "'")
In the form_unload event:
adodcSO.recordset.close
sors.close
cn.close
set adodcso.recordset = nothing
Set AdodcSO.Recordset.ActiveConnection = Nothing 'getting desperate here
set SOrs = nothing
set cn = nothing
...as mentioned....setting the filter property the first time works fine. If I don't navigate to a different customer but just arrive on the first customer which has orders displayed per the filter, I can even scroll through the orders for that customer in the adodcSO control. Then exit and the .ldb file is released. However if I scroll through the customer data control and it fires off a new filter, upon exiting the .ldb file remains and the database cannot be used exclusively for other purposes because it looks like it is still locked. If I comment out the filter assignment, I can still scroll between accounts (even though the orders then don't match up with the right account), and upon exiting, the .ldb file is released with no problem. This is all testing where I am the only user, so no chance of other users causing the .ldb lock.
I pretty much don't have any hair left. any help out there?