Solved

Using memory resident ADO recordsets

Posted on 2006-07-16
2
442 Views
Last Modified: 2013-12-25
Hi all,

I have been using memory resident ADO recordsets for a while in a Parent/Child relationship.  Now for the question:

Is it possible to have one parent with a child and have the child have children?  In other words, grandparent/parent/child relationship.

Here is code I am trying to play with:

           Set rsItems = New ADODB.Recordset
           Set rsItemsDtl = New ADODB.Recordset
           Set rsItemsInvDtl = New ADODB.Recordset
   
           rsItems.ActiveConnection = "provider=msdatashape;data provider=none;"
           rsItems.Open " SHAPE APPEND" & _
                " New adVarChar(40) as CustNbr, New adVarChar(100) as CustName, New adCurrency as YTD," & _
                " New adCurrency as LYYTD, New adCurrency as LY," & _
                " ((SHAPE APPEND New adVarChar(10) as chCustNbr," & _
                " New adVarChar(40) as chProductNbr, New adVarChar(100) as chProductDesc, New adVarChar(30) as chSize," & _
                " New adVarChar(10) as chMfg, New adVarChar(10) as chUnit, New adInteger as chQty," & _
                " New adCurrency as chYTD, New adInteger as chLYtdQty, New adCurrency as chLYYTD," & _
                " New adInteger as chLyQty, New adCurrency as chLY, New adVarChar(100) as chCustProd," & _
                " ((SHAPE APPEND New adVarChar(40) as chIDCustProd, New adVarChar(10) as chIDInvNbr," & _
                " New adDate as chIDInvDate, New adInteger as chIDQty, New adCurrency as chIDInvAmt)" & _
                " RELATE chCustProd to chIDCustProd) AS Child)" & _
                " RELATE CustNbr to chCustNbr) AS Child" _
                , , adOpenDynamic, adLockOptimistic

I know that I am not doing this correctly.

When answering, please provide an example.

Thanks,

Rick
0
Comment
Question by:rweiser
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17124108
looks looks like you have the code correct:
http://p2p.wrox.com/topic.asp?TOPIC_ID=24783

however, you named both levels "Child", possibly that makes it a problem.
possibly, using adOpenStatis instead of adOpenDynamic helps?

Sorry, I don't have VB on this computer...
0
 

Author Comment

by:rweiser
ID: 17126716
I was not using "GrandChild" in the code.

Thanks for your help.

Rick
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now