Take a look at my code in the following post. It does not generate an error when tested. Compare it to your code.

LDAP User Creation Question
_________________________
Home page: http://www.kixhelp.com/hb/