C
Crossh
Is it possible to just run a program, as needed, to create a local table in
Access from the Active Directory? It would only contain the information that
I need for use in my form? I am currently doing the following to read the
info, but it takes at least 30 seconds for each read. If not, any other ideas?
Set cnn = CreateObject("ADODB.Connection")
cnn.ConnectionString = "Provider=ADsDSOObject;Password=" & strUserPW &
";User ID=" & strUserId & ";Encrypt Password=True;Mode=Read;Bind Flags=0;ADSI
Flag=-2147483648"
cnn.Open
strSql = "SELECT DisplayName, Name, TelephoneNumber, Mail, Co, Department,
GivenName, SN FROM " & strLDAP WHERE samAccountName='*" & strUser & "' AND
objectCategory='person' AND objectClass='user'"
Set rst = cnn.Execute(strSql)
If Not rst.EOF Then
LdapLookup = True
Me.txtEmail = rst!mail
Me.txtPhone = rst!TelephoneNumber
Me.txtFirstName = rst!GivenName
Me.txtLastName = rst!SN
Me.txtLocation = rst!Co
Me.txtTeam = rst!Department
End If
cnn.Close
Access from the Active Directory? It would only contain the information that
I need for use in my form? I am currently doing the following to read the
info, but it takes at least 30 seconds for each read. If not, any other ideas?
Set cnn = CreateObject("ADODB.Connection")
cnn.ConnectionString = "Provider=ADsDSOObject;Password=" & strUserPW &
";User ID=" & strUserId & ";Encrypt Password=True;Mode=Read;Bind Flags=0;ADSI
Flag=-2147483648"
cnn.Open
strSql = "SELECT DisplayName, Name, TelephoneNumber, Mail, Co, Department,
GivenName, SN FROM " & strLDAP WHERE samAccountName='*" & strUser & "' AND
objectCategory='person' AND objectClass='user'"
Set rst = cnn.Execute(strSql)
If Not rst.EOF Then
LdapLookup = True
Me.txtEmail = rst!mail
Me.txtPhone = rst!TelephoneNumber
Me.txtFirstName = rst!GivenName
Me.txtLastName = rst!SN
Me.txtLocation = rst!Co
Me.txtTeam = rst!Department
End If
cnn.Close