Moin, Liste!
Ich habe folgendes Problem: Aus einer Intranetanwendung heraus kann ein
LDAP-Verzeichnis durchsucht werden. Hierzu nutze ich folgende sub:
sub getLdapInfo(thestr)
Dim objSettings, objUser
' iniLDAPBASE wird im include gesetzt
searchBase = iniLDAPBASE
attribs = "cn,givenName,sn,telephonenumber,mail"
scope = "subtree"
Dim oConnection, oRecordset, oCommand
if isNumeric(thestr) then
ldapFilter = "(telephonenumber=*"&thestr&"*)"
else
ldapFilter = "(sn=*"&thestr&"*)"
end if
Set oConnection = Server.CreateObject("ADODB.Connection")
Set oRecordset = Server.CreateObject("ADODB.Recordset")
Set oCommand = Server.CreateObject("ADODB.Command")
oConnection.Provider = "ADsDSOObject" 'The ADSI OLE-DB provider
oConnection.Properties("User ID") = ""
oConnection.Properties("Password") = ""
oConnection.Properties("Encrypt Password") = False
oConnection.Open "ADs Provider"
strQuery = "<"&searchBase&">;"&ldapFilter&";"&attribs&";"&scope
oCommand.ActiveConnection = oConnection
oCommand.CommandText = strQuery
oCommand.Properties("Page Size") = 99
Set oRecordset = oCommand.Execute
if oRecordset.RecordCount > 0 then
dId = 1
tableon "0", 5, 5, "100%"
rowon
tdon "td1" : textf "b", "Telefon (Firma)"
tdnext "td1" : textf "b", "Name"
tdnext "td1" : textf "b", "EMail"
tdoff
rowoff
text "<tr><td class=""td1"" colspan=""7"" style=""padding: 0px; height:
12px""><img src="""&rootPath&"images/black1pix.GIF"" height=""2""
width=""100%""></td></tr>"
while not oRecordset.EOF
rowon
tdon "td1" : text corr(oRecordset.Fields("telephonenumber"))
tdnext "td1" : text corr(oRecordset.Fields("cn"))
tdnext "td1" : text "<a
href=""mailto:"&corr(oRecordset.Fields("mail"))&""">"&corr(oRecordset.Fields
("mail"))&"</a>"
tdoff
oRecordset.MoveNext
rowoff
text "<tr><td class=""td1"" colspan=""7"" style=""padding: 0px""><img
src="""&rootPath&"images/black1pix.GIF"" height=""2""
width=""100%""></td></tr>"
wend
tableoff
else
textf "bn+", "Kein Eintrag im Telefonbuch gefunden!"
text "<script
language='Javascript'>self.document.formular.phoneToSearch.focus();</script>
"
end if
Set oRecordset = nothing
Set objConn = nothing
end sub
Die Formattierungsroutinen brauche ich Euch ja nicht zeigen.
Hat immer alles super geklappt, nur leider kann ich nach einem Absturz des
Rechners, nachdem der dortige SysAdmin alles neu aufgesetzt hatte, nur noch
einmal nach dem Systemstart bzw. Neustart innerhalb der allerersten Session
(!) diese LDAP-Abfrage nutzen. Alle nachfolgenden User werden mit einem
Ladebalken im Explorerfenster abgespeist und komplett ohne Fehlermeldung
abgespeist. Er tut's einfach nicht...
Das Problem tritt bei
Set oRecordset = oCommand.Execute
auf, kommentiere ich das aus, l�uft die Seite soweit erstmal durch.
Ist da vielleicht etwas zu installieren vergessen worden?
Warum l�uft die Seite aber beim ersten angemeldeten User / Session?
Ratlos gr��t Euch
Michael Schmidt
Hamburg
_______________________________________________
Coffeehouse mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/coffeehouse