RESOLUTION
There are workarounds available for this problem that are discussed in the "Workarounds" section.
NOTE: The fix described only addresses the problem if the following criteria are met:
- The recordset was not created with a parameterized query.
- The recordset does not have to be reconnected later to perform an update.
- The code that uses the recordsets can be modified as described in the "Enable a Full Disconnect" section later in this article.
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Data Access Components that contains this hotfix.
To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:
NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
The English version of this fix should have the following file attributes or later:
MDAC 2.6 Service Pack 1
File name Size Date Version
-----------------------------------------
Msadce.dll 336,144 07-Nov-2001 2.62.8106.0
Msadcer.dll 20,480 07-Nov-2001 2.62.8106.0
Msadcf.dll 65,808 07-Nov-2001 2.62.8106.0
Msadcfr.dll 12,288 07-Nov-2001 2.62.8106.0
Msadco.dll 147,728 07-Nov-2001 2.62.8106.0
Msadcor.dll 16,384 07-Nov-2001 2.62.8106.0
Msadcs.dll 57,616 07-Nov-2001 2.62.8106.0
Msadds.dll 168,208 07-Nov-2001 2.62.8106.0
Msaddsr.dll 24,576 07-Nov-2001 2.62.8106.0
Msdaprsr.dll 16,384 07-Nov-2001 2.62.8106.0
Msdaprst.dll 209,168 07-Nov-2001 2.62.8106.0
Msdarem.dll 123,152 07-Nov-2001 2.62.8106.0
Msdaremr.dll 16,384 07-Nov-2001 2.62.8106.0
Msdfmap.dll 37,136 07-Nov-2001 2.62.8106.0
MDAC 2.7
File name Size Date Version
-----------------------------------------
Msadce.dll 307,200 06-26-2002 2.70.9001.7
Msadcf.dll 57,344 06-26-2002 2.70.9001.7
Msadco.dll 131,072 06-26-2002 2.70.9001.7
Msadcs.dll 53,248 06-26-2002 2.70.9001.7
Msadds.dll 147,456 06-26-2002 2.70.9001.7
Msadaprst.dll 180,224 6-26-2002 2.70.9001.7
Msadarem.dll 110,592 6-26-2002 2.70.9001.7
Msadfmap.dll 32,768 06-26-2002 2.70.9001.7
Enable a Full Disconnect
After you apply the fix, you must enable the fix to properly use it. To to this, follow these steps:.
- Before you open the recordset, set its cursor location explicitly to client, and then set the following new property on the recordset:
rs.CursorLocation = adUseClient
rs.Properties("Release Shape On Disconnect") = True ' new property
- If your returned recordset is truly hierarchical (for example, it has child chapters), the ActiveConnection property of each of these must be set to Nothing (Visual Basic) or null (Java), or what is appropriate for the language that is used. This is simplified by using a recursive function such as the following:
DisconnectAll rs
Where DisconnectAll is defined as follows:
Private Function DisconnectAll(rs As ADODB.Recordset)
Dim i As Long
With rs
Set .ActiveConnection = Nothing
For i = 0 To rs.Fields.Count - 1
If (rs.Fields(i).Type = adChapter) Then
DisconnectAll rs.Fields(i).Value
End If
Next i
End With
End Function
Workarounds
If you have to create a series of disconnected recordsets from the same data source, the same connection object can be reused to create the second, the third, and any subsequent recordsets even when you disconnect the first recordset, and that connection remains open. This approach provides a solution without applying the fix that is described in this article.
There are alternative workarounds to this problem that may be more convenient and easier to use that are discussed in the following Knowledge Base article:
288409 Disconnected Hierarchical Recordset Does Not Disconnect from Database Server