BUG: E_FAIL Error When Referencing Child Recordset in Manually-Created Chaptered Recordsets

ID: Q246728


The information in this article applies to:
  • Microsoft Data Access Components version 2.1 SP2


SYMPTOMS

When using a manually-created chaptered (hierarchical) recordset where no Data Provider is needed, attempts to assign a reference on a child recordset to a Recordset object variable returns an E_FAIL error.

The problem does not occur in either MDAC 2.1 SP1 (version 02.10.3711) or if the chaptered recordset was created by selecting records from a backend database.


CAUSE

In this circumstance, since no Data Provider is needed to create the recordset, the member variable that keeps a reference to the Data Provider's session is being set to NULL.
Later, attempts are made to use this session member variable to create a command object without first checking to see if it is NULL, which generates an error.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next Microsoft Data Access Components service pack that contains this fix.

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 on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

The English version of this fix should have the following file attributes or later:

   Date      Time    Version      Size    File name     Platform
   -------------------------------------------------------------
   11/3/99           2.12.4703.0  299KB   msadce.dll

 

Workaround

There is no workaround for this problem. If a Data Provider is specified in an attempt to circumvent the problem, the shape provider attempts to connect to the database server when creating the recordset. Lacking any connection information, the connection attempt fails.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Manual Installation

  1. Close or stop any applications or services that are using Msadce.dll. This may include Internet Information Server (IIS), Microsoft Transaction Server (MTS), and any ADO, or OLE DB applications.


  2. Download the hotfix version of Msadce.dll into a temporary directory.


  3. Locate and rename the current version of Msadce.dll, which is in the \Program Files\Common Files\System\MSADC folder.


  4. Copy the hotfix version of Msadce.dll into the same location, and then restart your services and applications.


Steps to Reproduce Behavior

Copy the following code into a Visual Basic application, and add a reference to the Microsoft ActiveX Data Objects 2.1 Library. Run the code, and notice that an E_FAIL error occurs when attempting to save the reference to the child recordset into another Recordset object.

Dim strSQL As String
Dim objRs As ADODB.Recordset
Dim objRsChild As ADODB.Recordset
Dim objConn As ADODB.Connection
Dim objField As ADODB.Field

strSQL = "SHAPE APPEND  new adInteger as ParentID, ((SHAPE APPEND  new adInteger " & _
"as ChildID, new adVarChar(40) as Name) RELATE ParentID TO ChildID) AS Columns"

Set objConn = New ADODB.Connection
Set objRs = New ADODB.Recordset

objConn.Open "provider=MSDataShape;Data provider=NONE;"

objRs.CursorLocation = adUseClient

objRs.Open strSQL, objConn, adOpenStatic, adLockOptimistic

objRs.AddNew Array("ParentID"), Array(1)

Set objField = objRs.Fields.Item("Columns")

Set objRsChild = objField.Value ' <-- Failure occurs here 

Additional query words: datashape data shape provider e_fail error manually created creatable recordset reference child heirarchial chaptered

Keywords : kbDatabase kbMDAC kbDSupport kbMDAC210SP2fix
Version : WINDOWS:2.1 SP2
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: December 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.