DeleteProject Method
Description
Deletes a specified project using the Microsoft Office Project Server 2003 security object.
Syntax
Function DeleteProject( _
ByVal lProjID As Long, _
ByVal fFromPDS As Long _
) As Long
Parameters
Parameter | Description |
---|---|
lProjID |
Required Long. ID of the project to delete, as in MSP_WEB_PROJECTS.WPROJ_ID. |
fFromPDS |
Required Long. Set to 1 (True) if called from the Project Data Service (PDS); or 0 (False) if not called from the PDS. |
Return Value
The DeleteProject method returns HRESULT as a Long (4-byte integer) value.
Remarks
DeleteProject can call the PDS, and the PDS can also call DeleteProject. To avoid an infinite loop the fFromPDS flag indicates if the call is from the PDS; if it is from the PDS, then DeleteProject only deletes the project data in the MSP_WEB_ tables. If fFromPDS is 0 (False), DeleteProject also calls the PDS ProjectDelete method to clean up project data in the enterprise tables.
In user code, fFromPDS is always 0.
Example
The following example deletes project ID 112. The example is for Microsoft Visual Basic 6.0.
Dim lResult as Long
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.DeleteProject(112, 0)
Set oSec = Nothing