473,473 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Connecting to LDAP and querying for info

374 Contributor
Hi All,

Basically I have been destroying my brain trying to work out how to connect to the LDAP server at work with access to search for info and import.

I have a couple of questions. Firstly, what is the difference between LDAP and Active Directory? I can get basic information by running some vba to look up computernames real names etc from active directory but our LDAP contains more information such as addresses, telephone numbers but most importantly company specific information such as user id numbers for some of our systems which I will need to be querying.

My issue is I cant get my head around creating an ADO connectiont o the LDAP to get this information. I have tried and failed numerous times and just reverted back to my Active Directory code.

I have downloaded an LDAP viewer so I have the full server address etc to get down to the required level. The program brings this up as the server address:

Expand|Select|Wrap|Line Numbers
  1. ldap://scd2ldap.company.net:389/cn=GEEUER ANTJEE Z001VFMP S,l=SGX P,ou=E F,o=SUBCOMPANY,c=ES??base?(objectClass=*)
(edited out company name etc)

But I can never work out how exactly to put that part in to the code.

Does anyone have an example of what is possible? And also how I would place the server in to code correctly. I think the server part is the major downfall.


The code I have been using as a basis:
Expand|Select|Wrap|Line Numbers
  1.   Sub returnit()
  2.   Dim conn As ADODB.Connection
  3.       Dim rs As ADODB.Recordset
  4.  
  5.       Set conn = New ADODB.Connection
  6.       conn.Provider = "ADSDSOObject"
  7.       conn.Open "ADs Provider"
  8.  
  9.       Set rs = conn.Execute( _
  10.             "<LDAP://scd2ldap.COMPANY.net:389/o=SUBCOMPANY/ou=E F/cn=GEUEER ANTJEEE Z001VFMP S>;" _
  11.             & "(objectClass=*);ADsPath,objectClass,cn;subtree")
  12.  
  13.       While Not rs.EOF
  14.          Debug.Print rs.Fields(0).Value, rs.Fields(1).Value, _
  15.                rs.Fields(2).Value
  16.          rs.MoveNext
  17.       Wend
  18.  
  19.       conn.Close
  20. End Sub
  21.  
When I run the above code I get "Table does not exist"
Nov 25 '10 #1
2 9660
MMcCarthy
14,534 Recognized Expert Moderator MVP
Not my area of expertise I'm afraid, try this and see if it helps ...

Expand|Select|Wrap|Line Numbers
  1. "<LDAP://scd2ldap.company.net:389/o=SUBCOMPANY/ou=E F/cn=GEEUER ANTJEE Z001VFMP S,l=SGX P,c=ES??base?>;" _
  2.             & "(objectClass=*);ADsPath,objectClass,cn;subtree")
Nov 27 '10 #2
NeoPa
32,556 Recognized Expert Moderator MVP
Munkee:
what is the difference between LDAP and Active Directory?
LDAP is Lightweight Directory Access Protocol. As it says, it's a protocol that enables access to directory information.
Active Directory is such a repository of directory information.

You can use LDAP to interact with the Active Directory.

Your other thread on this deals with the addressing issues in your code so I won't comment on that here.
Nov 27 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike | last post by:
I'm using ASP and CDO to lookup free busy time on an e2k server. The E2K is locally installed on the IIS server and I'm having no problems accessing resources like public folders, mailboxes, etc....
0
by: CjB | last post by:
Good Morning, I am having some issues connecting to LDAP through PHP. I am using the function provided here: http://www.php.net/manual/en/function.ldap-bind.php (By 'edi01 at gmx dot at'). I...
3
by: SomeDude | last post by:
Lo group, During my quest for the "perfect" way for storing tree-structures it quickly became clear that all of the available SQL-solutions have their own peculiar weaknesses (scalability, slow...
2
by: CodeRazor | last post by:
I am trying to create an LDAP connection. I have managed to connect to "LDAP://myServerName" I now want to connect further down the directory tree, to a particular user group. I have tried...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
1
by: Laszlo Nagy | last post by:
Hello, I'm using the ldap module under Windows. This is the error that I get: import ldap l = ldap.initialize("ldaps://neptunus.msnet:636")...
3
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new...
1
by: sbettadpur | last post by:
hello i have problem with connecting to LDAP.... it means i have user created on server(192.168.0.35), if i try using user called srinath this type error i am receiving..........show below...
6
by: hotani | last post by:
I am attempting to pull info from an LDAP server (Active Directory), but cannot specify an OU. In other words, I need to search users in all OU's, not a specific one. Here is what works: con...
4
by: =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?= | last post by:
Hello, I am facing an issue while querying Active directory using C# code with system.DirectoryServices namespace. Here is the path for my LDAP - "LDAP://CN=XY - C++/Unix and other,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.