|
Home > Archive > MS Access Multiuser > August 2005 > Retrieve data from Active Directory to Access 2000 Database
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Retrieve data from Active Directory to Access 2000 Database
|
|
| carpathia 2005-07-29, 8:25 pm |
| Greetings from Colombia...
I need to retrieve the users information in my domain (name, account,
mail address), from Active Directory to an Access 2000 Database. I have
a Windows Server 2003 Controller, and and I have tried to do
programatically in Access with "ExOLEDB.DataSource" provider, but
always i got an error " '3706' could not find the specified
provider"....
=BFHow I can do it?
Thanks in Advance.
| |
| Graham R Seach 2005-07-29, 8:25 pm |
| Here is a small class I used for one customer.
'===================
====================
====================
====================
' IMPORTANT NOTE: Requires a Reference to the 'Active DS Type Library'.
'===================
====================
====================
====================
Private sComputerName As String
Private sDomainName As String
Private sPDCName As String
Private sUsername As String
Private sFullName As String
Private Sub GetSystemInfo()
'Returns the current computer name, domain name, PDC name and username
from Active Directory.
'Requires a Reference to the 'Active DS Type Library'.
Dim sysInfo As New ActiveDs.WinNTSystemInfo
On Error Resume Next
sComputerName = sysInfo.ComputerName
sDomainName = sysInfo.DomainName
sPDCName = sysInfo.PDC
sUsername = sysInfo.Username
GetFullName
Set sysInfo = Nothing
End Sub
Public Property Get ComputerName() As String
ComputerName = sComputerName
End Property
Public Property Get Surname() As String
Surname = Left(sFullName, InStr(1, sFullName, ",") - 1)
End Property
Public Property Get FirstName() As String
FirstName = Trim(Mid(sFullName, InStr(1, sFullName, ",") + 1))
End Property
Public Property Get FullName1() As String
FullName1 = FirstName & " " & Surname
End Property
Public Property Get DomainName() As String
DomainName = sDomainName
End Property
Public Property Get PDCName() As String
PDCName = sPDCName
End Property
Public Property Get Username() As String
Username = sUsername
End Property
Public Property Get FullName() As String
FullName = sFullName
End Property
Private Sub Class_Initialize()
GetSystemInfo
End Sub
Private Sub GetFullName()
Dim oComputer As ActiveDs.IADsComputer
Dim oIADs As ActiveDs.IADs
Dim oUser As ActiveDs.IADsUser
Dim oShare As ActiveDs.IADs
Dim oContainer As ActiveDs.IADsContainer
Dim oGroup As ActiveDs.IADsGroup
Dim sUserInfo
Set oContainer = GetObject("WinNT://" + sDomainName)
For Each oIADs In oContainer
If (oIADs.Class = "User") Then
Set oUser = oIADs
If oUser.Name = sUsername Then
'Debug.Print oUser.AccountDisabled
'Debug.Print oUser. AccountExpirationDat
e
'Debug.Print oUser.ADsPath
'Debug.Print oUser.Class
'Debug.Print oUser.Description
sFullName = oUser.FullName
'Debug.Print oUser.Guid
'Debug.Print oUser.HomeDirectory
'Debug.Print oUser.LastLogin
'Debug.Print oUser.LoginHours
'Debug.Print oUser.LoginScript
'Debug.Print oUser.MaxStorage
'Debug.Print oUser.Name
'Debug.Print oUser.Parent
'Debug.Print oUser. PasswordExpirationDa
te
'Debug.Print oUser. PasswordMinimumLengt
h
'Debug.Print oUser.PasswordRequired
'Debug.Print oUser.Profile
'Debug.Print oUser.Schema
End If
End If
Next oIADs
On Error Resume Next
Set oComputer = Nothing
Set oIADs = Nothing
Set oUser = Nothing
Set oShare = Nothing
Set oContainer = Nothing
Set oGroup = Nothing
End Sub
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
(Currently in Japan)
---------------------------
"carpathia" <oeforero@hotmail.com> wrote in message
news:1122667310.187434.48560@g47g2000cwa.googlegroups.com...
Greetings from Colombia...
I need to retrieve the users information in my domain (name, account,
mail address), from Active Directory to an Access 2000 Database. I have
a Windows Server 2003 Controller, and and I have tried to do
programatically in Access with "ExOLEDB.DataSource" provider, but
always i got an error " '3706' could not find the specified
provider"....
¿How I can do it?
Thanks in Advance.
| |
| david epsom dot com dot au 2005-08-02, 3:24 am |
| To see a complete list of OLE DB providers installed on your
computer, create an empty text file on your desktop, change
the file extension from .txt to .udl, and open (double click)
the file.
or look in your registry at
HKCR\CLSID\OLEDB_SER
VICES\OLE DB Provider
(david)
"carpathia" <oeforero@hotmail.com> wrote in message
news:1122667310.187434.48560@g47g2000cwa.googlegroups.com...
Greetings from Colombia...
I need to retrieve the users information in my domain (name, account,
mail address), from Active Directory to an Access 2000 Database. I have
a Windows Server 2003 Controller, and and I have tried to do
programatically in Access with "ExOLEDB.DataSource" provider, but
always i got an error " '3706' could not find the specified
provider"....
¿How I can do it?
Thanks in Advance.
|
|
|
|
|