By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

ldap_get_values gives LDAP_DECODING_ERROR

P: 2
I am using the following code but the ldap_get_values funtions returns me the following error LDAP_DECODING_ERROR.


if (ldap_search_s (m_pLdapConnection, tcsDN, LDAP_SCOPE_SUBTREE, SearchFilter, pattribs, 0, &lMsg) == LDAP_SUCCESS)
{
(tcspValue = ldap_get_values (m_pLdapConnection, lMsg, (PTSTR) tcsInit)) != NULL)
}

can you please help me ??
Jun 15 '07 #1
Share this Question
Share on Google+
3 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Are you missing some code?
if (ldap_search_s (m_pLdapConnection, tcsDN, LDAP_SCOPE_SUBTREE, SearchFilter, pattribs, 0, &lMsg) == LDAP_SUCCESS)
{
(tcspValue = ldap_get_values (m_pLdapConnection, lMsg, (PTSTR) tcsInit)) != NULL)
}
Maybe it's should be this way??
Expand|Select|Wrap|Line Numbers
  1. if (ldap_search_s (m_pLdapConnection, tcsDN, LDAP_SCOPE_SUBTREE, SearchFilter, pattribs, 0, &lMsg) == LDAP_SUCCESS)
  2. {
  3.      if ((tcspValue = ldap_get_values (m_pLdapConnection, lMsg, (PTSTR) tcsInit)) != NULL)
  4.      {
  5.               /* got the values*/
  6.      }
  7.      else
  8.      {
  9.              /* error */
  10.       }
  11.  
  12. }
  13.  
Jun 15 '07 #2

P: 2
The actual code is like this.
Expand|Select|Wrap|Line Numbers
  1. if (ldap_search_s (m_pLdapConnection, tcsDN, LDAP_SCOPE_SUBTREE, SearchFilter, pattribs, 0, &lMsg) == LDAP_SUCCESS)
  2.     {
  3.         int flag = 0;
  4.         for ( e = ldap_first_entry ( m_pLdapConnection, lMsg); e != NULL; e = ldap_next_entry ( m_pLdapConnection, e ) ) 
  5.         {
  6.             flag = 1;
  7.             TCHAR tcsInit [MAX_PATH] = {0};
  8.             _tcscpy (tcsInit, _T("objectCategory"));
  9.             if ( ( tcspValue = ldap_get_values (m_pLdapConnection, lMsg, (PTSTR) tcsInit)) != NULL ) 
  10.             {
  11.                 for ( int i = 0; tcspValue[i] != NULL ; i++ ) 
  12.                 { //Success
  13.                                                                 }
  14.                                                  }
  15.                                                 else
  16.                                                  {
  17.                                                                //failure
  18.                                                  }
  19.                              }
  20.                              else
  21.                                     //failure
  22.                 }
  23.                 else
  24.                          //failure
  25.  
  26.  
Plz help folks. it's urgent.



Are you missing some code?


Maybe it's should be this way??
Expand|Select|Wrap|Line Numbers
  1. if (ldap_search_s (m_pLdapConnection, tcsDN, LDAP_SCOPE_SUBTREE, SearchFilter, pattribs, 0, &lMsg) == LDAP_SUCCESS)
  2. {
  3.      if ((tcspValue = ldap_get_values (m_pLdapConnection, lMsg, (PTSTR) tcsInit)) != NULL)
  4.      {
  5.               /* got the values*/
  6.      }
  7.      else
  8.      {
  9.              /* error */
  10.       }
  11.  
  12. }
  13.  
Jun 18 '07 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
How do you know you are getting an LDAP_DECODING_ERROR when all I see is a test for LDAP_SUCCESS??
Jun 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.