Project code is setting Res_EUID field to null

C

Chris Clement

I am opening a project...

proj = new Microsoft.Office.Interop.MSProject.ApplicationClass();
proj.Alerts(false);
proj.DisplayAlerts = false;
proj.DisplayScheduleMessages = false;
object oMissing = Missing.Value;
projFound = proj.FileOpen(strProject, //Name
false, //read only
oMissing, //Merge
oMissing, //TaskInformation
oMissing, //Table
oMissing, //Sheet
true, //NoAuto
"sa", //UserID
"password", //DataBase Password
"MSProject.ODBC", //FormatID
oMissing, //Map*-
PjPoolOpen.pjDoNotOpenPool, //OpenPool
"password", //Password
oMissing, //WriteResPassword
true, //IgnoreReadOnlyRecommended
oMissing //XMLName
);

....set the field values...

proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualStart,
tbActStart.Text);
proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualFinish,
tbActFinish.Text);

.....setting some "options"...

proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing);


proj.OptionsWorkgroup(PjWorkgroupMessages.pjWorkgroupViaWeb,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, false, true,
oMissing, true, true, oMissing, oMissing, oMissing);
proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing);

...and then calculating and saving...

proj.CalculateProject();
proj.PublishNewAndChangedAssignments(false,
PjPublishScope.pjPublishScopeAll, false, oMissing);
proj.FileSave();
proj.FileExit(PjSaveType.pjDoNotSave);

....Everything seems to be working except that the Res_Euid field in the
MSP_Resources table is set to null. Since we are using this resource
reference to determine if a user has permissions to edit the schedule,
setting this reference to null is preventing the user (Resource) from doing
so.

What am I doing that is changing the value in this field?

Thanks.

Chris
 
C

Chris Clement

Chris Clement said:
I am opening a project...

proj = new Microsoft.Office.Interop.MSProject.ApplicationClass();
proj.Alerts(false);
proj.DisplayAlerts = false;
proj.DisplayScheduleMessages = false;
object oMissing = Missing.Value;
projFound = proj.FileOpen(strProject, //Name
false, //read only
oMissing, //Merge
oMissing, //TaskInformation
oMissing, //Table
oMissing, //Sheet
true, //NoAuto
"sa", //UserID
"password", //DataBase Password
"MSProject.ODBC", //FormatID
oMissing, //Map*-
PjPoolOpen.pjDoNotOpenPool, //OpenPool
"password", //Password
oMissing, //WriteResPassword
true, //IgnoreReadOnlyRecommended
oMissing //XMLName
);

...set the field values...

proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualStart,
tbActStart.Text);
proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualFinish,
tbActFinish.Text);

....setting some "options"...

proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing);


proj.OptionsWorkgroup(PjWorkgroupMessages.pjWorkgroupViaWeb,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, false, true,
oMissing, true, true, oMissing, oMissing, oMissing);
proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing);

..and then calculating and saving...

proj.CalculateProject();
proj.PublishNewAndChangedAssignments(false,
PjPublishScope.pjPublishScopeAll, false, oMissing);
proj.FileSave();
proj.FileExit(PjSaveType.pjDoNotSave);

...Everything seems to be working except that the Res_Euid field in the
MSP_Resources table is set to null. Since we are using this resource
reference to determine if a user has permissions to edit the schedule,
setting this reference to null is preventing the user (Resource) from doing
so.

What am I doing that is changing the value in this field?

Thanks.

Chris

Nevermind. I realized that I could actually compare the Res_Name, which
does not get nulled, instead of the Res_UID. Thanks anyway.
 

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