WebLdapAttributeAdd Function

Action

Adds a new attribute to an LDAP directory entry.

Include file

WebAPI.bdh

Syntax

WebLdapAttributeAdd( in hLdap      : number, 
                     in nModType   : number, 
                     in sAttribute : string ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hLdap Handle to a Web connection that was created by WebLdapConnect
nModType

Specifies the type of modification. It can be one of the following:

  • WEB_LDAP_MOD_ADD. Add a directory entry

  • WEB_LDAP_MOD_DELETE. Delete a directory entry

  • WEB_LDAP_MOD_REPLACE. Replace a directory entry

sAttribute Specifies the attribute type in the given entry to which the modification applies. It is simply a string indicating the attribute type name, for example, "mail", "cn", ...

Example

dcltrans 
  transaction TMain 
  var
    hLdap: number; 
  begin
    WebLdapConnect(hLdap, "standardhost", WEB_PORT_LDAP);
    WebLdapBind(hLdap, "cn=adminname", "password"); 
    WebLdapAttributeAdd(hLdap, WEB_LDAP_MOD_REPLACE, "attribute");
    WebLdapValueAdd(hLdap, "value");
    WebLdapModify(hLdap, "cn=TestCN,o=Name");
    WebLdapDisconnect(hLdap); 
  end TMain;

SilkEssential sample

LDAP.sep