How I can translate GetObject("LDAP://RootDSE") in (x)harbour code.
Thanks in advance
hr = ADsGetObject(TEXT("LDAP://rootDSE"),
IID_IADs,
(void**)&pRoot);
#include 'fivewin.ch'
#include "ado.ch"
#include "xBrowse.ch"
STATIC oLdap
*---------------------
FUNCTION ConectaLDAP()
*---------------------
LOCAL lOk := .F.
LOCAL oError
TRY
oLdap := TOleAuto():new("ADODB.Connection")
oLdap:Provider := 'ADsDSOObject'
oLdap:Open( "Active Directory Provider" )
lOk := .T.
CATCH oError
ShowError( oError )
END
RETU lOk
...
TRY
cString := "SELECT " + ;
" displayName," + ;
" distinguishedName," + ;
" mail," + ;
" telephoneNumber," + ;
" mobile," + ;
" facsimileTelephoneNumber," + ;
" otherTelephone," + ;
" department," + ;
" sAMAccountname"
cFrom := " FROM 'LDAP://teudomini'"
cWhere := " WHERE objectCategory = 'person' AND" + ;
" objectClass = 'user' "
oRs := TOleAuto():new("ADODB.RecordSet")
oRs:ActiveConnection := oLDap
oRs:Open( cString + cFrom + cWhere, oLDap , 1, 3 )
xBrowse( oRs )
oRs:Close()
CATCH oError
xBrowse( oError )
END
...
...
oCmd := TOleAuto():new("ADODB.Command")
oCmd:ActiveConnection := oLdap
oCmd:CommandText := cString + cFrom + cWhere
oProp := oCmd:Properties( 'SearchScope' )
oProp:value := ADS_SCOPE_SUBTREE
oProp := oCmd:Properties( 'Page size' )
oProp:value := 2000
...
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 18 guests