OOps
Typo in first reply- didn't refer to same alias:
Try using an alias for the childRs column:
SHAPE {SELECT AMT FROM tblDetails where AMT=3D'" & vPassValue &
"'} as MasterDetails" & " APPEND ({SELECT AMT,MarriageID, Name,
BirthDate,
MarriageDate,Profession FROM tblMarriages} as DetMarriages RELATE AMT
TO
AMT) as ColumnAlias"
> -----Original Message-----
> From: Cremieux, Judith K.
> Sent: Thursday, May 30, 2002 10:11 AM
> To: professional vb
> Subject: [pro_vb] RE: Hierarchical Recordsets AND DataGrid
>
> Try using an alias for the childRs column:
> SHAPE {SELECT AMT FROM tblDetails where AMT=3D'" & vPassValue &
> "'} as MasterDetails" & " APPEND ({SELECT AMT,MarriageID, Name,
BirthDate,
> MarriageDate,Profession FROM tblMarriages} as DetMarriages RELATE AMT
TO
> AMT) as ColumnAlias_theDetails"
>
> Set dgDocDetails.DataSource =3D rsdetails("ColumnAlias").value
>
> But you may want to use another rs as the intermediate recordset.
(This will let you code for events on the child easily)
> After the load:
> set rs =3D rsdetails("ColumnAlias").value
> (DO this also on the rsDetails_MoveComplete event )
>
> Set dgDocDetails.DataSource =3D rs
> This works for regular Datagrids and Component 1's TrueGrid
>
> > -----Original Message-----
> > From: George Theodorakopoulos [SMTP:gtheo@b...]
> > Sent: Thursday, May 30, 2002 3:09 AM
> > To: professional vb
> > Subject: [pro_vb] Hierarchical Recordsets AND DataGrid
> >
> > Good Morning!
> > I use hierarchical recordsets to retrieve data from 2 tables. I
want to
> > display the "appended" recordset into a datagrid (dgDocDetails) but
it does
> > not work... the error message is "Type missmatch"... Could you help
me?
> >
> > Thanx a lot
> >
> >
> > the code i wrote :
> >
> >
> > Set rsDetails =3D CreateObject("ADODB.Recordset")
> > QuerySTR =3D "" & _
> > " SHAPE {SELECT AMT FROM tblDetails where AMT=3D'" &
vPassValue &
> > "'} as MasterDetails" & _
> > " APPEND ({SELECT AMT,MarriageID, Name, BirthDate,
> > MarriageDate,Profession FROM tblMarriages} as DetMarriages RELATE
AMT TO
> > AMT)"
> >
> > rsDetails.CursorLocation =3D adUseClient
> >
> > rsDetails.Open QuerySTR, oUserControl.oDBConnection, adOpenKeyset,
> > adLockOptimistic
> > Set dgDocDetails.DataSource =3D rsDetails("DetMarriages")
> > (It works if i change the above sentence to : "Set
dgDocDetails.DataSource =3D
> > rsDetails" but i dont want to display the first recordset... i did
it for a
> > test)
> >
> >
> >
>