General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
How to merge ADODB recordsets - Crystal
I have a Crystal report that is currently used with access. It takes multiple queries to get to the final query that populates the report.
I am trying to move the report to use in a VB app instead of access. I have changed the report datasource to a ttx file and now I need to figure out how to merge multipe recordsets into 1. I considered continuing to use the dao queries but it takes 2 - 3 minutes to run the report from VB and we are eventually going to be switching to SQL. I am attempting to get as much as done now so that in 3 months when we switch over there will not be a delay in running reports.
Here is a sample of my access code:
sql = "SELECT FOB_Customer_Header.*, Customer.Name, Address.Line1, Address.Line2, Address.City, Address.State, " & _
"Address.Zip, Address.Phone, Address.Fax, Address.Country " & _
"FROM (Customer INNER JOIN FOB_Customer_Header ON Customer.Customer = FOB_Customer_Header.Customer) " & _
"INNER JOIN Address ON Customer.Customer = Address.Customer " & _
"WHERE (Address.Ship_To_ID = 'Main') " & _
"AND FOB_Customer_Header.qhIndex = " & v_Customer & " "
Set QueryDef = CurrentDb.CreateQueryDef("d_Customer_Quote_1", sql)
sql = "SELECT d_Customer_Quote_1.*, Contact.Contact_Name as Buyer_Name " & _
"FROM d_Customer_Quote_1 LEFT JOIN Contact ON d_Customer_Quote_1.Buyer = Contact.Contact;"
Set QueryDef = CurrentDb.CreateQueryDef("d_Customer_Quote_2", sql)
sql = "SELECT d_Customer_Quote_2.*, Contact.Contact_Name as Buyer_Name2 " & _
"FROM d_Customer_Quote_2 LEFT JOIN Contact ON d_Customer_Quote_2.Buyer2 = Contact.Contact;"
Set QueryDef = CurrentDb.CreateQueryDef("d_Customer_Quote_3", sql)
*******************
d_Customer_Quote_3 would be what I am trying to send to Crystal as 1 ado recordset.
I would appreciate any help.
Thanks
Nichole
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only