Solved

Using memory resident ADO recordsets

Posted on 2006-07-16
2
465 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

770 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