How do you join two recordsetdefs together?

J

JohnK

Dear All,
I am struggling to join two recordsetdefs:

sSQL1 = "SELECT AssignmentUniqueID , AssignmentResourceName FROM
Assignments WHERE AssignmentRemainingWork>0"

sSQL2 = "SELECT AssignmentUniqueID, AssignmentTimeActualWork ,
AssignmentTimeWork, AssignmentTimeStart FROM AssignmentTimephasedByDay
WHERE AssignmentTimeWork>AssignmentTimeActualWork"

Data1.ConnectionString = "Provider=Microsoft.Project.OLEDB.11.0;Project
Name=Master.mpp"

set rsdef1 = Data1.RecordsetDefs.AddNew(sSQL1,
Data1.Constants.dscCommandText, "AssignmentParent")

set rsdef2 = Data1.RecordsetDefs.AddNew(sSQL2,
Data1.Constants.dscCommandText, "AssignmentDetails")

Set rsdef3 = Data1.SchemaRelationships.Add("Joined",
Data1.SchemaRowsources.item(0),Data1.SchemaRowsources.item(1),
Data1.SchemaRowsources.item(0).SchemaFields(0)
,Data1.SchemaRowsources.item(1).SchemaFields.item(0))

Can anyone show me how to get two recordsets to be joined by
AssignmentUniqueID?
Thanks for your help.
Best Wishes, John.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top