Share via


IsAccountNameConflict Method

Description

Checks whether the specified resource name and Microsoft Windows NT account name (if any) exist in the Microsoft Office Project Server database, using the Microsoft Office Project Server 2003 security object. If the name and account exist, IsAccountNameConflict also verifies that the resource ID matches the name.

Syntax

Function IsAccountNameConflict( _
   ByVal lResID As Long, _
   ByVal fNTAccount As Long, _
   ByVal bstrNewName As String, _
   ByVal bstrNTAccount As String _
) As Long

Parameters

Parameter Description

lResID

Required Long. The resource WRES_ID.

fNTAccount

Required Long. Set to 1 (True) if the account is a Windows NT account; set to 0 (False) if not.

bstrNewName

Required String. The new resource name to check.

bstrNTAccount

Required String. The new Windows NT account name to check.

Return Value

The IsAccountNameConflict method returns HRESULT as a Long (4-byte integer) value. A return value of 0 means there is no account name conflict. Any other return value, such as -1945894863, shows a conflict.

Remarks

If fNTAccount is 0, bstrNTAccount is not checked.

Example

The following example validates that the administrator has a Project Server account with resource ID 1. The example is for Microsoft Visual Basic 6.0.

Dim lResult as Long
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.IsAccountNameConflict(1, 0, "administrator", "")
Set oSec = Nothing