Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / March 2005



Tip: Looking for answers? Try searching our database.

Connecting Active Directory with visualbasic6.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shankar - 27 Nov 2004 06:31 GMT
Hi, I am using Visual Basic6.0. I am having a login form where username and
password are stored in database. But i want to use the active directory
information
to login into the project. I don't want the user to have separate login for
the projects.
Jonathan Moreno - 17 Mar 2005 16:57 GMT
You have to ways of doing this, using DirectoryServices or ActiveDs. Here is
a sample code of how you can connect to your active directory using
DirectoryServices

Dim x As Object
       Dim i As Integer
       Dim User As New
System.DirectoryServices.DirectoryEntry("LDAP://xxx.xxx.xxx.255/CN=user,OU=Venezuela,OU=Sales,DC=company, DC=com")
       Dim entry As DirectoryServices.DirectoryEntry
       Dim mySearcher As New
System.DirectoryServices.DirectorySearcher(entry)
       Dim result As System.DirectoryServices.SearchResult

       If TextNombre.Text = "" Then Exit Sub
       i = 0
       mySearcher.Filter = ("(anr=" & TextNombre.Text & ")")
       ListBox1.Items.Clear()

       For Each result In mySearcher.FindAll()
           ListBox1.Items.Add(result.GetDirectoryEntry().Path)
           User = result.GetDirectoryEntry
           Do While i < User.Properties.Count
               x = User.Properties.Item(i)
               i += 1
           Loop
           ListBox1.Items.Add(User.Properties.Item("sn"))  '
User.Properties("HomeNumber")(0))

           'Para que sean realizados los cambios
           'User.CommitChanges()
           '-------------------------------------
       Next

I hope this can give you a hint where to start looking for the
authentication part.
JMP

> Hi, I am using Visual Basic6.0. I am having a login form where username and
> password are stored in database. But i want to use the active directory
> information
> to login into the project. I don't want the user to have separate login for
> the projects.
shankar - 31 Mar 2005 10:15 GMT
Thanx.

> You have to ways of doing this, using DirectoryServices or ActiveDs. Here is
> a sample code of how you can connect to your active directory using
[quoted text clipped - 38 lines]
> > to login into the project. I don't want the user to have separate login for
> > the projects.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.