In Delphi, you can use two ways of getting at your data:
either the "SQL'ish" syntax you describe - basically ADO access to Active Directory. That's easy, if you have a SQL background, but it's also limited in some ways (e.g. you cannot get at multi-valued attributes and such). You'll find some Search Tips on ADO on Richard Mueller's site (AD Programming MVP)
import the ActiveDs.tlb type library and use the COM interfaces (most notably IDirectorySearch
) provided by ADSI to search. It's a rather messy COM interface, that's probably why most tend to use the ADO search stuff which is more readily approachable
Way back when I was still programming Delphi, I did a lot of Active Directory stuff and puts some of my Delphi / AD tips and some sample code onto my site. It's not been updated in quite a while though :-( But the ADSISearch component might be of interest to you (and other Delphites)
Update: can you try this "SQL-ish" statement in your TADOCommand??
SELECT sAMAccountName, displayName
FROM 'LDAP://OU=Groups,DC=office,DC=domain,DC=org'
WHERE objectCategory='group'
AND member:1.2.840.113556.1.4.1941:=(CN=adam smith,OU=Users,DC=office,DC=domain,DC=org)