Microsoft KB Archive/192805

From BetaArchive Wiki

Article ID: 192805

Article Last Modified on 3/2/2005



APPLIES TO

  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.1
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft ActiveX Data Objects 2.6
  • Microsoft ActiveX Data Objects 2.7



This article was previously published under Q192805

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 that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why


194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed


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 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 that you have a DSN for the SQL Server Northwind database called "Northwind."
  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;Data Provider=MSDASQL;" & _
             "Data Source=Northwind; uid=<user>; pwd=<password>;"
             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.


Keywords: kberrmsg kbbug kbfix kbado201fix kbdatabase kbmdacnosweep kbvs600sp3fix KB192805