Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Access Connecting to Active Directory

Status
Not open for further replies.

entonne

MIS
Feb 2, 2005
6
US
I don't know VBA and am sort of muddling through. I found the following but I can't figure out why I can't pass domainObject to the ExportUsers function without getting the following error:
"Wrong number of arguments or invalid property assignment" but it works when I do this:
ExportUsers (GetObject("LDAP://" & domainContainer))

Code:
Sub Search()
Dim rootDSE, domainObject
Set rootDSE = GetObject("LDAP://RootDSE")
domainContainer = rootDSE.Get("defaultNamingContext")
Set domainObject = GetObject("LDAP://" & domainContainer)
ExportUsers (domainObject)
End Sub

Sub ExportUsers(oObject)
Do Stuff
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top