This is what works in my Cmd.exe console:
It returns something that looks like:
dn: auid=pppep, aid=it0030, ou=Applications, o=domain.com, c=US lastaccesstime: 20040922120851Z
notice the dn and lastaccesstime
I'm trying to run this query in Access to return the same results. So far, I have the following that returns the same amount of records, but not the same output:
My output for this is:
LDAP://directorydev.domain.com/auid=pppep, aid=it0030, ou=Applications, o=domain.com, c=us
notice how lastaccestime is not included, and the LDAP server is
I tried changing
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);ADsPath;subtree"
to
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);ADsPath,dn,lastaccestime;subtree"
and I tried
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);dn,lastaccesstime;subtree"
but nothing works other than ADsPath or *
**Note:
lastaccesst ime (above) = lastaccesstime
sub tree (above) = subtree
the forum has a bug
**
-Thanks to whomever will try to figure this out,
modest
Code:
ldapsearch -D "cn=Directory Manager" -w password -h directorydev.domain.com -b aid=it0030,ou=Applications,o=domain.com,c=us userreferencedn=*xternal* dn lastaccesstime
It returns something that looks like:
dn: auid=pppep, aid=it0030, ou=Applications, o=domain.com, c=US lastaccesstime: 20040922120851Z
notice the dn and lastaccesstime
I'm trying to run this query in Access to return the same results. So far, I have the following that returns the same amount of records, but not the same output:
Code:
Dim con As ADODB.Connection
Dim com As ADODB.command
Dim rs As ADODB.Recordset
Dim ADsPath As String
ADsPath = "LDAP://directorydev.domain.com/aid=it0030,ou=Applications,o=domain.com,c=us"
[COLOR=Green] 'set the connection[/COLOR]
Set con = New ADODB.Connection
With con
.Provider = "ADSDSOObject"
'.Properties("User ID") = "cn=Directory Manager" [COLOR=Green]',aid=it0030,ou=Applications,o=domain.com,c=us"[/COLOR]
'.Properties("Password") = "password"
.Open "ADSI"
End With
[COLOR=Green] 'set the command object[/COLOR]
Set com = New ADODB.command
With com
.ActiveConnection = con
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);ADsPath;subtree"
End With
Set rs = com.Execute
If Not (rs.BOF And rs.EOF) Then
rs.MoveLast
rs.MoveFirst
MsgBox rs.RecordCount & "'s Returned"
While Not rs.EOF
MsgBox rs.Fields(0).Value
rs.MoveNext
Wend
End If
con.Close
My output for this is:
LDAP://directorydev.domain.com/auid=pppep, aid=it0030, ou=Applications, o=domain.com, c=us
notice how lastaccestime is not included, and the LDAP server is
I tried changing
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);ADsPath;subtree"
to
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);ADsPath,dn,lastaccestime;subtree"
and I tried
.CommandText = "<" & ADsPath & ">;(userreferencedn=*xternal*);dn,lastaccesstime;subtree"
but nothing works other than ADsPath or *
**Note:
lastaccesst ime (above) = lastaccesstime
sub tree (above) = subtree
the forum has a bug
**
-Thanks to whomever will try to figure this out,
modest
Last edited: