ActivateAccount Method

Description

Sets the activation state of a Microsoft Office Project Server 2003 account using the Project Server security object. The Project Data Service (PDS) uses ActivateAccount to activate or deactivate an account, so ActivateAccount does not call the PDS again to synchronize account information.

Syntax

Function ActivateAccount( _
   ByVal lResID As Long, _
   ByVal fActivate As Long _
) As Long

Parameters

Parameter Description

lResID

Required Long value of the resource ID for the desired account. The value is the same as the MSP_WEB_RESOURCES.WRES_ID field in the Project Server database.

fActivate

Required Long values can be:

  • 1 (True): Activate
  • 0 (False): Deactivate

Return Value

The ActivateAccount method returns HRESULT as a Long (4-byte integer) value.

Remarks

DeleteAccount is recommended to delete an enterprise resource.

Example

The following example is for Microsoft Visual Basic 6.0.

Dim lResult as Long
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.ActivateAccount(26, 1)
Set oSec = Nothing