The following line is missing a ' before and after the strUser attribute around the user id: objCommand.CommandText = "SELECT sAMAccountName,scriptPath,ADsPath FROM " & _ "'LDAP://dc=help,dc=xp,dc=org' " & _ "WHERE sAMAccountName = " & strUser It should be: objCommand.CommandText = "SELECT sAMAccountName,scriptPath,ADsPath FROM " & _ "'LDAP://dc=help,dc=xp,dc=org' " & _ "WHERE sAMAccountName = '" & strUser & "'"
... View more