操作系统之间的 LDAP 连接差异
我有在两个不同系统上执行 LDAP 查询的相同方法。该方法非常简单:
Public Function AutenticaDominio(ByVal user As String, ByVal ambiente As String) As String
Dim Comm As New ADODB.Command
Dim conn As New ADODB.connection
Dim rs As New ADODB.Recordset
Dim codiceBanca As String
Dim currentAmbiente As String
Dim currentName As String
Dim trovato As Boolean
Dim UserName As String
Set conn = CreateObject("ADODB.Connection")
conn.Provider = "ADsDSOObject"
conn.Properties("User ID") = "XXX"
conn.Properties("Password") = "XXX"
conn.Open "DS Query", "XXX", "XXX"
Set Comm = CreateObject("ADODB.Command")
Set Comm.ActiveConnection = conn
Comm.CommandText = "SELECT SBAcodicebanca FROM 'LDAP://abc.cde.fgh.it/ou=bank,dc=cde,dc=it' WHERE uid = '" & user & "' and SBAelencoambienti = 'sbacodicesottoambiente=GEST,sbacodiceambiente=PROT,ou=applicazioni,dc=cde,dc=it'"
rs.CursorLocation = adUseClient
Set rs = Comm.Execute
If rs.EOF = False Then
If rs.Fields.Item(0) = "099" Then
Autentica = rs.Fields.Item(0)
Exit Function
Else
Autentica = ""
End If
Else
Autentica = ""
End If
End Function
rs.execute 语句,在 Windows XP 上运行该方法时返回“未指定错误”。该方法在 Windows 7 上运行良好。
该项目是相同的,具有相同的参考和组件。
有谁知道哪里可能出现错误?
i have the same method that performs an LDAP query on two different system. The method is very simple:
Public Function AutenticaDominio(ByVal user As String, ByVal ambiente As String) As String
Dim Comm As New ADODB.Command
Dim conn As New ADODB.connection
Dim rs As New ADODB.Recordset
Dim codiceBanca As String
Dim currentAmbiente As String
Dim currentName As String
Dim trovato As Boolean
Dim UserName As String
Set conn = CreateObject("ADODB.Connection")
conn.Provider = "ADsDSOObject"
conn.Properties("User ID") = "XXX"
conn.Properties("Password") = "XXX"
conn.Open "DS Query", "XXX", "XXX"
Set Comm = CreateObject("ADODB.Command")
Set Comm.ActiveConnection = conn
Comm.CommandText = "SELECT SBAcodicebanca FROM 'LDAP://abc.cde.fgh.it/ou=bank,dc=cde,dc=it' WHERE uid = '" & user & "' and SBAelencoambienti = 'sbacodicesottoambiente=GEST,sbacodiceambiente=PROT,ou=applicazioni,dc=cde,dc=it'"
rs.CursorLocation = adUseClient
Set rs = Comm.Execute
If rs.EOF = False Then
If rs.Fields.Item(0) = "099" Then
Autentica = rs.Fields.Item(0)
Exit Function
Else
Autentica = ""
End If
Else
Autentica = ""
End If
End Function
The rs.execute statement, return an "unspecified error" where i run the method on a windows XP. The method works well on Windows 7 instead.
The project is the same, with the same references and components.
Does anyone know where could be the error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论