Hi, I am trying to retrieve the userCertificate via LDAP with the code below. Unfortunatly the Recordset which should contain the certificate is always NULL. With a network sniffer on port 389 I can see that the certificate arrives. Why is it not in the Recordset? Any ideas? I use for my sample code ADODB but if you have other suggestions how to solve my problem I am happy as well. Kind Regards MichM on error resume next Dim bla As String Dim conn As ADODB.Connection Dim rs As ADODB.Recordset err.clear Set conn = New ADODB.Connection conn.Provider = "ADSDSOObject" conn.Open "ADs Provider" Set rs = conn.Execute( _ "<LDAP://ldap.myserver.com/dc=myserver,dc=com>;" _ & "(&(mail=test@myserver.com));ADsPath,userCertificate,cn;subtree") If rs.RecordCount > 0 And Err.Number = 0 Then While Not rs.EOF bla = "" bla = bla + "," + CStr(rs.Fields(0).Value) bla = bla + "," + CStr(rs.Fields(1).Value) bla = bla + "," + CStr(rs.Fields(2).Value) Debug.Print bla rs.MoveNext Wend End If conn.Close
ignore this please - found the solution. Thanks! "Michael Mueller" wrote in message news:uf1$HV72FHA.472@TK2MSFTNGP15.phx.gbl... > Hi, > > I am trying to retrieve the userCertificate via LDAP with the code below. > Unfortunatly the Recordset which should contain the certificate is always > NULL. With a network sniffer on port 389 I can see that the certificate > arrives. Why is it not in the Recordset? Any ideas? > > I use for my sample code ADODB but if you have other suggestions how to > solve my problem I am happy as well. > > Kind Regards > MichM > > on error resume next > Dim bla As String > Dim conn As ADODB.Connection > Dim rs As ADODB.Recordset > > err.clear > Set conn = New ADODB.Connection > conn.Provider = "ADSDSOObject" > conn.Open "ADs Provider" > Set rs = conn.Execute( _ > "<LDAP://ldap.myserver.com/dc=myserver,dc=com>;" _ > & > "(&(mail=test@myserver.com));ADsPath,userCertificate,cn;subtree") > > If rs.RecordCount > 0 And Err.Number = 0 Then > While Not rs.EOF > bla = "" > bla = bla + "," + CStr(rs.Fields(0).Value) > bla = bla + "," + CStr(rs.Fields(1).Value) > bla = bla + "," + CStr(rs.Fields(2).Value) > Debug.Print bla > rs.MoveNext > Wend > End If > conn.Close >