5 Replies - 31555 Views - Last Post: 03 August 2009 - 07:13 AM Rate Topic: -----

#1 juniorm   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-August 07

LDAP connection using VB6

Posted 05 November 2007 - 07:22 AM

How do i connect to an Active Directory server using VB6. Im programming an application that has to import employee data from an Active directory. Im trying to connect to the Ladp using VB6. Is there a way i cud do it.

Thanks guys
Is This A Good Question/Topic? 0
  • +

Replies To: LDAP connection using VB6

#2 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7420
  • View blog
  • Posts: 15,382
  • Joined: 16-October 07

Re: LDAP connection using VB6

Posted 05 November 2007 - 07:49 AM

The magic words you're looking for are System.DirectoryServices.

Here's a writeup: http://www.ondotnet..../activedir.html
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: LDAP connection using VB6

Posted 05 November 2007 - 09:02 AM

View Postbaavgai, on 5 Nov, 2007 - 06:49 AM, said:

The magic words you're looking for are System.DirectoryServices.

Here's a writeup: http://www.ondotnet..../activedir.html


He's using VB6 not .Net so that will not work for him
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: LDAP connection using VB6

Posted 05 November 2007 - 09:19 AM

You need to start by looking into the ActiveDS Type Library for VB6. This is a set of objects designed for effectively querying the Active Directory in VB6. Following is an example of what can be accomplished with this library.

This function queries the active directory searching the groups to see if the username provided is a member of that group.

Public Function IsInGroup(username As String,  domain As String, _
  group As String) As Boolean
'=================================================
'=================================================
'   Purpose:	To determine if a user is a member of a specified group
'   Arguments:
'			   username		-- login ID of user to verify
'			   domain	  -- Domain name the user and group reside in, can also use IP Address of Primary Domain Controller)
'			   group-- NT Group name to match the user to
'   Useage:	IsInGroup("myusername", "mydomain", "mygroupname")
'==========================================================
'==========================================================
	Dim user As IADsUser
	Dim grp As Object
	IsInGroup = False
	Set user = GetObject("WinNT://" & domain & "/" & username & ",user")
	For Each grp In user.Groups
		If group = grp.Name Then IsInGroup = True
	Next
End Function



That should at least get you started :)
Was This Post Helpful? 0
  • +
  • -

#5 juniorm   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-August 07

Re: LDAP connection using VB6

Posted 05 November 2007 - 10:55 PM

U are simply the best! U mo than a hero, Im inspired :^: :)
Was This Post Helpful? 0
  • +
  • -

#6 Chr1s1nho   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-August 09

Re: LDAP connection using VB6

Posted 03 August 2009 - 07:13 AM

hi i have a problem i want to show the authentication window of xp im doing a program which need to authenticate the user when this press save button but i dont know how to do this pls help me to do that !

This post has been edited by Chr1s1nho: 04 August 2009 - 07:07 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1