Click here to Skip to main content
14,971,099 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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



Is it possible to connect LDAP server in vb6.

Please help on this issue...

Please help .........
Posted
Updated 30-Jun-11 19:19pm
v5
Comments
Nagy Vilmos 23-Jun-11 8:46am
   
Have you got GOOD reason to use VB6? It is, to put it mildly, a dead language.
Sergey Alexandrovich Kryukov 23-Jun-11 13:50pm
   
What is VB6?
--SA
Nagy Vilmos 1-Jul-11 8:34am
   
The cheap version of a V6.
   
:-)

1 solution

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.
   
Comments
Kiran S. S. 29-Jun-11 0:28am
   
@dasblinkenlight: Thanks for your help.

But I am using VB 6.

The code you are suggesting is useful for .net.

Please suggest for VB 6.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900