Guest_imported
New member
- Jan 1, 1970
- 0
I have a recordset hierarchy, created in Data Environment Designer, that looks like this:
rsGetHeaderRecs
GetLineItems - 1 to n records per Header record
GetCharges - 1 to n number of records per Header
I need to write some of the data out to a text file (as opposed to bind to a control or display on a form). How do I go about stepping through the records and fields returned by the child commands? Just to make things interesting, both Line Items and Charges contain a field with the same name ("DESCRIPTION".
Will something like this (example adapted from MSDN Lib CD) work for multiple child records? Or do I even need to set up separate recordset objects for them?
rsGetHeaderRecs.StayInSync = TRUE
rsGetHeaderRecs.Open "SHAPE etc....
"APPEND etc....
"RELATE etc....
While Not rsGetHeaderRecs.EOF
'Do stuff with current Header Record
Set rsGetLineItems = _
rsGetHeaderRecs("rsGetLineItems".Value
While Not rsGetLineItems.EOF
'Do stuff with current Line Item Record
rsGetLineItems.MoveNext
Wend
rsGetHeaderRecs.MoveNext
Wend
Thanks in advance..
Lee
lee.meinhardt@smna.com
rsGetHeaderRecs
GetLineItems - 1 to n records per Header record
GetCharges - 1 to n number of records per Header
I need to write some of the data out to a text file (as opposed to bind to a control or display on a form). How do I go about stepping through the records and fields returned by the child commands? Just to make things interesting, both Line Items and Charges contain a field with the same name ("DESCRIPTION".
Will something like this (example adapted from MSDN Lib CD) work for multiple child records? Or do I even need to set up separate recordset objects for them?
rsGetHeaderRecs.StayInSync = TRUE
rsGetHeaderRecs.Open "SHAPE etc....
"APPEND etc....
"RELATE etc....
While Not rsGetHeaderRecs.EOF
'Do stuff with current Header Record
Set rsGetLineItems = _
rsGetHeaderRecs("rsGetLineItems".Value
While Not rsGetLineItems.EOF
'Do stuff with current Line Item Record
rsGetLineItems.MoveNext
Wend
rsGetHeaderRecs.MoveNext
Wend
Thanks in advance..
Lee
lee.meinhardt@smna.com