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.
Graham R Seach - 29 Jul 2005 23:10 GMT
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.AccountExpirationDate
'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.PasswordExpirationDate
'Debug.Print oUser.PasswordMinimumLength
'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)
---------------------------
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 - 02 Aug 2005 03:30 GMT
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_SERVICES\OLE DB Provider
(david)
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.