Error No value given for one or more parameters
I can create a SQL statement to find evey record but when I want to add a where clause it never works.
I can create a SQL statement to find evey record but when I want to add a where clause it never works.
Code:
Sql = "SELECT Name,Manager,vLegacyPersonType,Givenname,sn,vEmplStatus FROM [LDAP$] " & _
"Where vEmplStatus = " & Chr(34) & "Active" & Chr(34) & ""
[code]
gives this
SELECT Name,Manager,vLegacyPersonType,Givenname,sn,vEmplStatus FROM [LDAP$] Where vEmplStatus = "Active"
or I tried this
SELECT Name,Manager,vLegacyPersonType,Givenname,sn FROM [LDAP$] Where vEmplStatus = 'Active'
and this
SELECT Name,Manager,vLegacyPersonType,Givenname,sn FROM [LDAP$] Where vEmplStatus = [Active]
this works fine if I leave out the "Where" part...
SELECT Name,Manager,vLegacyPersonType,Givenname,sn FROM [LDAP$]
but I want the active people and would rather not have to examine each record to see if they are 'active' or not in the loop.
Any ideas?
TIA
DougP