How do you use Data Shape with Project Files?

J

john.kaye

I am trying to use Data Shape to join Assignments to
AssignmentsTimePhasedByDay. My connection String is:

sMPP = "D:\Master.mpp"
sConn = "Provider=MSDATASHAPE;Extended Properties='Project Name=" +
sMPP + _
"';Persist Security Info=False;Data Source='';User ID='';Initial
Catalog=" + sMPP + _
";Data Provider=Microsoft.Project.OLEDB.11.0"

The connection works with simple select statements like:

sSQL = "SELECT AssignmentRemainingWork , AssignmentResourceName,
AssignmentStart FROM Assignments WHERE AssignmentRemainingWork>0"

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

sSQL= "SELECT AssignmentUniqueID, AssignmentTimeActualWork ,
AssignmentTimeWork, AssignmentTimeStart FROM AssignmentTimephasedByDay
" & _
" WHERE AssignmentTimeWork > AssignmentTimeActualWork"

As soon as I use SHAPE, I get an error message: data provider failed
while executing a provider command e.g.

sSql = "SHAPE {SELECT TaskUniqueId FROM Tasks} APPEND ({SELECT
TaskUniqueID, ResourceUniqueID FROM Assignments} RELATE 'TaskUniqueId'
TO 'TaskUniqueId')"

The Shape commend I want to execute is:
sSQL = "SHAPE {SELECT AssignmentUniqueID , AssignmentResourceName FROM
Assignments WHERE AssignmentRemainingWork>0}" & _
" APPEND ({ SELECT AssignmentUniqueID, AssignmentTimeActualWork ,
AssignmentTimeWork, AssignmentTimeStart FROM AssignmentTimephasedByDay
" & _
" WHERE AssignmentTimeWork > AssignmentTimeActualWork } AS Details" & _
" RELATE 'AssignmentUniqueID' TO 'AssignmentUniqueID')"

Can anyone help me out here?
Thank in advance.
Best Wishes, John.
 
M

Mike Glen

Hi John,

Try posting on the developer newsgroup as this one is closing down. Please
see FAQ Item: 24. Project Newsgroups. FAQs, companion products and other
useful Project information can be seen at this web
address:http://project.mvps.org/faqs.htm .

Mike Glen
Project MVP
 

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