DeleteAccount Method
Description
Deactivates a Microsoft Office Project Server account for a specified resource using the Microsoft Office Project Server 2003 security object.
Syntax
Function DeleteAccount( _
ByVal lResID As Long, _
ByVal bstrResName As String, _
ByVal lAdminRandomSeed0 As Long, _
ByVal lAdminRandomSeed1 As Long = 0, _
Optional ByVal fDeleteEntRes As Long = 0, _
Optional ByVal bstrResReName As String = "0" _
) As Long
Parameters
Parameter | Description |
---|---|
lResID |
Required Long. The resource ID for the account, as in MSP_WEB_RESOURCES.WRES_ID. |
bstrResName |
Required String. The resource name, as in MSP_WEB_RESOURCES.RES_NAME. bstrResName is used to reset the security cookies. |
lAdminRandomSeed0 |
Required Long. A random number. |
lAdminRandomSeed1 |
Required Long. A random number. |
fDeleteEntRes |
Optional Long. Set to 1 (True) to also delete the enterprise tables for the resource account. |
bstrResReName |
Optional String. The changed name after this account is deleted. The account is just deactivated in the MSP_WEB_RESOURCES table. Choose a name that won't conflict with other names in the future, for example, "Resource Name (deleted 01/21/2004)". |
Return Value
The DeleteAccount method returns HRESULT as a Long (4-byte integer) value.
Remarks
If the resource is an enterprise resource, DeleteAccount also calls the Project Data Service (PDS) method ResourcesDelete to remove the resource from the enterprise resource pool.
Example
The following example deactivates resource ID 120 and removes the resource from the enterprise resource pool. The example is in Microsoft Visual Basic 6.0.
Dim lResult as Long
Dim lSeed0 as Long
Dim lSeed1 as Long
' Assign long integer random values to lSeed0 and lSeed1
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.DeleteAccount(120, "Resource Name", lSeed0, lSeed1,
1, "Resource Name (deleted 01/21/2004)")
Set oSec = Nothing