Anyone know of any reason I would not be able to select the 'department' from within asp? My code is included below. I am completely new to ldap and things just aren't making sense to me. I can write the query and reference the 'department' in the 'where' clause but cannot select it. What am I missing plz?
Set objDomain = GetObject ("GC://RootDSE"
objADsPath = objDomain.Get("defaultNamingContext"
Set objDomain = Nothing
Set con = Server.CreateObject("ADODB.Connection"
con.provider ="ADsDSOObject"
con.open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command"
Set Com.ActiveConnection = con
Com.CommandText ="select department from 'GC://"+objADsPath+"' where department='Info*' and CN='R*' order by sn"
Set rs = Com.Execute
If I change the select to be 'select cn. . .' it works. It seems like some fields just won't select. The error returned is simply 'Unspecified error'.
TIA!!
J
Set objDomain = GetObject ("GC://RootDSE"
objADsPath = objDomain.Get("defaultNamingContext"
Set objDomain = Nothing
Set con = Server.CreateObject("ADODB.Connection"
con.provider ="ADsDSOObject"
con.open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command"
Set Com.ActiveConnection = con
Com.CommandText ="select department from 'GC://"+objADsPath+"' where department='Info*' and CN='R*' order by sn"
Set rs = Com.Execute
If I change the select to be 'select cn. . .' it works. It seems like some fields just won't select. The error returned is simply 'Unspecified error'.
TIA!!
J