Share via


IBDSecurity::AddAccount Method [C++]

This method is used by the Permissions module and dialog box to add new user or group accounts to the Security Definitions Tables (SDT).

Definition

[C++]

HRESULT IBDSecurity::AddAccount(BSTRbstrAccountName,
  _Recordset**ppRSAccount);

[Visual Basic]

Function AddAccount(bstrAccountName As String,
) As _Recordset

Parameters

  • bstrAccountName [C++]
    [in] A BSTR that contains the account name, either with or without a domain specifier. The account name can specify an individual user or a group.
  • bstrAccountName [Visual Basic]
    A String that contains the account name, either with or without a domain specifier. The account name can specify an individual user or a group.
  • ppRSAccount [C++]
    [out, retval] The address of a pointer to an ADO _Recordset object used to return information about the newly added account. See the Remarks section for more details.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns an ADO _Recordset object that contains information about the newly added account. See the Remarks section for more details.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

This method will not typically be called from any Commerce Server Business Desk modules other than the Permissions module and dialog box.

The returned record set contains a single record for the added user or group and includes the fields: SID (security identifier), AccountName, and IsGroup.

This method must be called for a particular account before the SetPermissions method is called for that account.

[Java, C++] The ppRSAccount parameter contains valid data only if the method returns successfully.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' rsAccount is a Variant to which an ADO _Recordset object will be assigned.
' g_MSCSBizDeskSecurityis the global BD security object created in the page Global.asa.

rsAccount = g_MSCSBizDeskSecurity.AddAccount("domain1\joeuser")

See Also

[C++] BDSecurity Object

[Visual Basic] BDSecurity Object

Security

Copyright © 2005 Microsoft Corporation.
All rights reserved.