DOCUMENT:Q192805 21-SEP-1998 [vbwin] TITLE :BUG: Hierarchical Child Recordset and ADO Data Control PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:2.0,6.0 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Professional and Enterprise Editions, for Windows, version 6.0 - ActiveX Data Objects (ADO), version 2.0 --------------------------------------------------------------------- SYMPTOMS ======== Creating a Hierarchical recordset and trying to assign the child recordset to the "ado data control" results in an error: "Method 'Recordset' of object 'IAdodc' failed". STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. Create a new Visual Basic Standard EXE project. Form1 is created by default. 2. Add a reference to "Microsoft ActiveX Data Objects 2.0 Library." Also, under Project/Components, add "Microsoft ADO Data Control 6.0(OLEDB)." 3. Add a CommandButton and ADO data control to Form1. 4. Make sure you have a DSN for the Northwind database called "nwind." 5. Paste the following code in the General Declarations section: Dim Conn As ADODB.Connection Dim MainRS As ADODB.Recordset Private Sub Command1_Click() Dim XRs as ADODB.Recordset Set Conn = New ADODB.Connection Conn.ConnectionString = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=nwind;Data Provider=MSDASQL" Conn.Open Set MainRS = New ADODB.Recordset MainRS.CursorLocation = adUseClient Call MainRS.Open(" SHAPE {SELECT * FROM `Customers` WHERE CustomerID = 'ALFKI'} AS Customer APPEND ({SELECT * FROM `Orders`} AS OrderChapter RELATE 'CustomerID' TO 'CustomerID') AS CustomerOrders", Conn, adOpenStatic, adLockBatchOptimistic) Set XRs = MainRs.Fields("CustomerOrders").Value Set adodc1.recordset = XRs End Sub 6. Click on the CommandButton and note that the error above is returned. Additional query words: kbDSupport kbdse kbVBp600bug kbVBp kbADO200bug kberrmsg ====================================================================== Version : WINDOWS:2.0,6.0 Platform : WINDOWS Issue type : kbbug ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.