求助VB程序编译出错
在网上找了一段VB程序,编译不过去,请教VB高手。看看问题在哪里?Private ldapPath As String
Public Function Authenticate(strUsername, strPassword) As Boolean
On Error GoTo handler
Dim oDSObj As IADsOpenDSObject
Dim oAuth As IADs
' --- Use OpenDSObject to bind with credentials ---
If strUsername <> "" And strPassword <> "" Then
Set oDSObj = GetObject("LDAP:")
Set oAuth = oDSObj.OpenDSObject(ldapPath, strUsername, strPassword, 4)
Authenticate = True
Set oDSObj = Nothing
Set oAuth = Nothing
Else
Authenticate = False
End If
Exit Function
handler:
Authenticate = False
End Function
Public Sub setLDAPPath(strLDAPPath)
'该方法允许用户自己设定LDAP服务的地址
ldapPath = strLDAPPath
End Sub
Private Sub Class_Initialize()
ldapPath = "LDAP://192.168.0.5:389"
End Sub
已经在vb中引用active ds type library
但调试的过程出错:
错误 1 未定义类型“IADsOpenDSObject”。 C:\tmp\ldapauth\ldapauth\Class1.vb 6 23 ldapauth
错误 2 未定义类型“IADs”。 C:\tmp\ldapauth\ldapauth\Class1.vb 7 22 ldapauth
请问该如何修改? 谢谢!
--------------------编程问答-------------------- 引用模块不存在或者没进行注册!
补充:VB , 控件