Solved

Using memory resident ADO recordsets

Posted on 2006-07-16
2
484 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

726 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