Hi everybody,
I am not able to access the rows in a child recordset of a hierarchial recordset, generated using MSDataShape. Following is the code :
On running this procedure, it shows the error "Object doesn't support this property or method." at "Do Until rPrintChild.EOF". I am using ADO 2.0 Library. I tried using ADO 2.1 & 2.5, but that doesn't help. Please help me.Code:Private Sub Report() Dim ConnShape As New ADODB.Connection, _ rPrint As New ADODB.Recordset, rPrintChild As Variant With ConnShape .Provider = "MSDataShape" .Open "Shape Provider=" & Provider & _ ";driver={SQL Server}" & _ ";server=" & DataSource & _ ";uid=" & UserID & _ ";pwd=" & Password & _ ";database=" & "InvMEDI2001" End With With rPrint .StayInSync = False .Open "SHAPE {SELECT * FROM UOM_Master} " & _ "APPEND ({SELECT * FROM Conv_Master} " & _ "RELATE uom TO uom) AS Conv", _ ConnShape, adOpenForwardOnly, adLockReadOnly, adCmdText Do Until .EOF Debug.Print .Fields("uom").Value Set rPrintChild = rPrint("Conv") Do Until rPrintChild.EOF Debug.Print rPrintChild(0), rPrintChild(1) MoveNext Loop .MoveNext Loop End With End Sub




Reply With Quote