Microsoft KB Archive/265500

= LDAP Queries That Contain the Single-Quotation Character (') Fail =

Article ID: 265500

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Site Server 3.0 Standard Edition
 * Microsoft Site Server 3.0 Commerce Edition

-



This article was previously published under Q265500



SYMPTOMS
You may receive one of the following LDAP error messages when you delete a user (even if the user is known to exist):

LDAP_NO_SUCH_OBJECT

LDAP_OPERATIONS_ERROR

The following LDAP error message may occur when you add a user (even though the user was successfully deleted):

LDAP_ALREADY_EXISTS

The error messages occur when you perform an LDAP query similar to the following:  >;(|(cn=*o'brien*)(mail=*o'brien*)); ADsPath, cn, mail;subtree NOTE: This behavior occurs when you use either Microsoft Access or Microsoft SQL Server as the database.



CAUSE
This is caused by the single quotation mark (') that is used in the search filter. When the SQL statement is built, the code cannot process the single quotation mark, so it translates the filter into LIKE '%O'brien%', which has unbalanced quotation marks, and therefore causes a syntax error.

NOTE: The correct translation should be LIKE '%O''brien%'.



WORKAROUND
To work around this issue, specify '*O''brien*&quot; instead of &quot;*O'brien* when you submit the query.



RESOLUTION
To resolve this problem, obtain the latest service pack for Site Server version 3.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

219292 How to Obtain the Latest Site Server 3.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Site Server 3.0. This problem was first corrected in Site Server 3.0 Service Pack 4.



MORE INFORMATION
For additional information about related LDAP fixes, click the article numbers below to view the articles in the Microsoft Knowledge Base:

265502 LDAP Queries That Use the ADSI NOT Character (!) in a Filter May Work Incorrectly

258670 ADSI Filters May Return Incorrect Results When Text Is Inside a Filter Match

252178 LDAP Search 'Not Present' Filter Does Not Work with Membership

247953 Error Message: The Object You Tried to Create Already Exists in the Directory

231732 Updating Member Properties Using ADSI May Cause Corruption

Steps to Reproduce this Behavior
Repeat the following steps several times (typically between two and four times):  Add Members that are used for testing.  Perform an LDAP query similar to the following:  >;(|(cn=*o'brien*)(mail=*o'brien*)); ADsPath, cn, mail;subtree  Remove the Members that were used in testing.</li></ol>

Additional query words: single quote apostrophe akz

Keywords: kbbug kbfix kbqfe kbsiteserv300sp4fix KB265500

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.