|
-
Jul 3rd, 2002, 02:44 AM
#1
Thread Starter
Hyperactive Member
[Resolved] Not able to access rows in child recordset
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 :
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
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.
Last edited by Utpal; Jul 3rd, 2002 at 05:19 AM.
It is easy when you know it.
-
Jul 3rd, 2002, 04:55 AM
#2
Fanatic Member
I think that to get a handle on the child recordset, you must set a recordset object to the value of the field and not field itself:
VB Code:
Set rPrintChild = rPrint("Conv").Value
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Jul 3rd, 2002, 05:18 AM
#3
Thread Starter
Hyperactive Member
Thanks Simonm ! That worked.
It is easy when you know it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|