在与VB6进行LDAP连接方面需要帮助

问题描述:

大家好,

我打算连接到VB 6中的LDAP服务器.以下代码.
相同的LDAP服务详细信息可以与Java代码一起正常使用,但
在vb 6中给出错误运行时错误''-2147217865(80040e37)'':表剂量不存在

代码

Hi every one,

I am tring to conect to LDAP server in VB 6. Following code.
same LDAP serve details are working correctly with Java code but
giving error in vb 6 Run Time error ''-2147217865(80040e37)'': Table dose not exist

Code

<pre lang="vb">Dim conn As ADODB.Connection
    Dim rs As ADODB.Recordset

    Set conn = New ADODB.Connection
    conn.Provider = "ADSDSOObject"
    conn.Open "ADs Provider"

    Set rs = conn.Execute( _
          "<LDAP://server/o=organization/ou=site/cn=recipients>;" _
          & "(objectClass=*);ADsPath,objectClass,cn;subtree")

    While Not rs.EOF
       Debug.Print rs.Fields(0).Value, rs.Fields(1).Value, _
             rs.Fields(2).Value
       rs.MoveNext
    Wend

    conn.Close




是否可以在vb6中连接LDAP服务器.

请帮助解决此问题...

请帮助.........




Is it possible to connect LDAP server in vb6.

Please help on this issue...

Please help .........

我总是使用 ^ ]而不是LDAP到DB的映射:它更加直接,因为它不会将LDAP概念强制引入为关系DB设计的框架中. 此处 [
I always use directory service APIs[^] instead of LDAP-to-DB mapping: it''s a lot more direct, because it does not force LDAP concepts into a framework designed for relational DBs. Here[^] is a good example in C#. Microsoft documentation has short examples in VB as well.