I need to query LDAP using a variable as part of the select statement. This syntax won't work. Is is possible to do this and if so, how can I correct this so that it will work? Thanks!
samvariable = johnD
"SELECT mail FROM 'LDAP://dc=fabrikam,dc=com' WHERE objectCategory='user' " & _
"AND sAMAccountName=" & samvariable