?
Solved

Using memory resident ADO recordsets

Posted on 2006-07-16
2
Medium Priority
?
511 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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 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