Mission2000
Programmer
I am using VB to access the Cisco DC Directory LDAP server using the code below. I want to retrieve the sn and givenName values of the Users LDAP objects. However, I get a VB Multiple Step OLEDB Error when I try to retrieve any values but the objectClass or manager. It will let me retrieve those without any problems.
I can however, use Microsoft's LDP program to retrieve them just fine. For instance, if I use LDP to retrieve my user CN, I get this.
Expanding base 'ou=Users,o=cisco.com'...
Result <0>: Success
Matched DNs:
Getting 1 entries:
>> Dn: ou=Users,o=cisco.com
1> ou: USers;
2> objectClass: organizationalUnit; top;
-----------
Expanding base 'cn=CHolland,ou=Users,o=cisco.com'...
Result <0>: Success
Matched DNs:
Getting 1 entries:
>> Dn: cn=CHolland,ou=Users,o=cisco.com
1> cn: CHolland;
1> sn: Holland;
6> objectClass: inetOrgPerson; organizationalPerson; ciscoocUser; dcdPerson; person; top;
1> departmentNumber: Cola_Engineering;
1> givenName: Clint;
1> mail: CHolland;
1> telephoneNumber: 3405;
1> ciscoatUserProfile: cn=CHolland-profile-{60344261128012005},ou=profiles,ou=CCN,o=cisco.com;
1> ciscoatUserProfileString: cn=CHolland-profile-{60344261128012005},ou=profiles,ou=CCN,o=cisco.com;
1> ciscoatGUID: -{60344261128012005};
But when I use VB like this, I get the error. I only get the error when I try to retrieve a field other than Field(1) or Field(6). 1 is the objectClass and 6 is the manager.
Public Sub Test()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strTest
Set conn = New ADODB.Connection
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"
Set rs = conn.Execute("<LDAP://10.30.0.1:8404/O=cisco.com/OU=Users>;(objectClass=*);sn,objectClass,cn,departmentNumber,givenName,mail,manager,telephoneNumber;subtree")
While Not rs.EOF
strTest = rs.Fields(3).Value
rs.MoveNext
Wend
conn.Close
End Sub
Any ideas??
I can however, use Microsoft's LDP program to retrieve them just fine. For instance, if I use LDP to retrieve my user CN, I get this.
Expanding base 'ou=Users,o=cisco.com'...
Result <0>: Success
Matched DNs:
Getting 1 entries:
>> Dn: ou=Users,o=cisco.com
1> ou: USers;
2> objectClass: organizationalUnit; top;
-----------
Expanding base 'cn=CHolland,ou=Users,o=cisco.com'...
Result <0>: Success
Matched DNs:
Getting 1 entries:
>> Dn: cn=CHolland,ou=Users,o=cisco.com
1> cn: CHolland;
1> sn: Holland;
6> objectClass: inetOrgPerson; organizationalPerson; ciscoocUser; dcdPerson; person; top;
1> departmentNumber: Cola_Engineering;
1> givenName: Clint;
1> mail: CHolland;
1> telephoneNumber: 3405;
1> ciscoatUserProfile: cn=CHolland-profile-{60344261128012005},ou=profiles,ou=CCN,o=cisco.com;
1> ciscoatUserProfileString: cn=CHolland-profile-{60344261128012005},ou=profiles,ou=CCN,o=cisco.com;
1> ciscoatGUID: -{60344261128012005};
But when I use VB like this, I get the error. I only get the error when I try to retrieve a field other than Field(1) or Field(6). 1 is the objectClass and 6 is the manager.
Public Sub Test()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strTest
Set conn = New ADODB.Connection
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"
Set rs = conn.Execute("<LDAP://10.30.0.1:8404/O=cisco.com/OU=Users>;(objectClass=*);sn,objectClass,cn,departmentNumber,givenName,mail,manager,telephoneNumber;subtree")
While Not rs.EOF
strTest = rs.Fields(3).Value
rs.MoveNext
Wend
conn.Close
End Sub
Any ideas??