Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Query LDAP using VB6

Posted on 2007-11-14
4
Medium Priority
?
3,767 Views
Last Modified: 2013-12-24
I was given the task to add LDAP functionality in a VB6 app but I have no LDAP experience. I am able to get some of what I'm looking for but not everything. Take a look at the namespace doc supplied to me at http://www.mikkeee.com/misc/namespace.gif.

-com
--corphome
---people
----people
----executives
----union
----international
---pseudo-accounts
----franchisees
----consultants
----vendors

Dim sConn As String
    sConn = "LDAP://parr.corphome.com:636/dc=com/dc=corphome/ou=people/cn=johndoe")
    Set LDAPinfo = GetObject(sConn)
    MsgBox  "Name:" & LDAPinfo.Get("Parrpayname")

The above allows me to get what I want when I'm looking into the people ou but the problem I'm facing is that I also need to search in the vendors ou which is under pseudo-accounts.

sConn = "LDAP://parr.corphome.com:636/dc=com/dc=corphome/ou=pseudo-accounts/ou=people/cn=johndoe")
This does not work.

Any suggestions would be helpful.

Thanks
0
Comment
Question by:Mikkeeee
2 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 1000 total points
ID: 20284874
0
 
LVL 5

Expert Comment

by:23637269
ID: 20780124
I don't know if this will work or not but if MsgBox  LDAPinfo.Get("pseudo-accounts") returns the name of the account you want then.
Dim sPseudoAccount as string
sPseudoAccount = LDAPinfo.Get("pseudo-accounts")

sPseudoAccount should contain "CompanyABC"
You want to build the next string with the value of what sPseudoAccount contains.
That is where the @ comes in.  It tells the computer to use the value that the variable is holding, otherwise you would be using the name of the variable.

sConn = "LDAP://parr.corphome.com:636/dc=com/dc=corphome/ou=" & @sPseudoAccount  & "/ou=people/cn=johndoe")

Hope this helps or at least points you in the right direction, I haven't used LDAP before.

Thanks
Roger
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question