473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

ldap_get_values gives LDAP_DECODING_ERROR

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
3 2293
weaknessforcats
9,208 Expert Mod 8TB
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
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
9,208 Expert Mod 8TB
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

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

Similar topics

2
by: newbie | last post by:
Hi all , I'm using CDO from my vb component to fire email. The problem is whenever one of the email addresses in to, or cc is wrong then none of the mails are fired even to the correct...
8
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the...
2
by: Börni | last post by:
Hi, I'm just wondering why one cant do something like this outside of an function: alert(document.getElementById("edit")); this just gives null, but inside a function it works.
4
by: IMS.Rushikesh | last post by:
Hi All, I am trying to execute below code but it gives me an COMException ///// Code Start //// public string GetName(Excel.Range range) { try { if (range.Name != null)
6
by: vips | last post by:
Page_Load datagrid1.datasource=dataset1 //I am filling the datagrid and it works fine when page is displayed end ---------------
17
by: aamircheema | last post by:
Hi, When I compile my program adding -O option, the running time of my program is much smaller. For example if i compile my program like this g++ -Wall -g prog2.cc avltree.cc cells_list.cc...
1
by: Tejas | last post by:
Hi, I am using ldap_get_values() call to get the user attributes from LDAP. This call is returning the user attributes in UTF-8 encoding and its a PCHAR*. For normal English characters this...
1
by: Pradeep | last post by:
Hi All, I am facing an issue where length method of std::string class gives a junk value when used in a expression. Here's an example. The code should not go into the for loop but it does...
3
by: Peng Yu | last post by:
Hi, I don't understand why rbegin() -rend() gives a negative number. Since rbegin() + 1 gives the one before the last element, I think rbegin() - rend() should give a positive number. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.