I'm trying to access to a LDAP server by a
VB 6 application in order to get info about user.
The following code works fine running on
Windows 2000 professional but fails on
Windows XP.
Can anybody give me any information
about this kind of conflict ?
Thank you
I'm including in my VB project' references :
- Microsoft ActiveX Data Objects 2.5 Library (msado25.tlb)
- Active DS Type Library (activeds.tlb)
Dim con As ADODB.Connection
Dim ocommand As ADODB.Command
' Create ADO connection object for Active Directory
Set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Properties("ADSI Flag") = ADS_USE_SSL + ADS_SERVER_BIND
con.Open "Active Directory Provider"
' Create ADO command object for the connection.
Set ocommand = CreateObject("ADODB.Command")
ocommand.ActiveConnection = con
Set oRoot = GetObject("LDAP://nomeserverldap

ortnumber/O=myorganization")
.......
At this point I get the error :
err.Number = -2147016646
err.Description = Automation Error
I also tried to execute
LDAP://nomeserverldap

ortnumber/O=myorganization
straight from RUN menu and again, on Windows 2000 professional all works fine,
while on XP I get this error message
"The specified directory service could not be reached.
The service may be temporarily unavailable or the server name may be incorrect"