Active X Problem in VB .NET
Hi,
I am trying to use ADSI to get some user details.
My development machine is Windows 2000 but our PDC and our Domain is on windows NT 4.0.
I have the following code, which brings back the Domain and the PDC corrrectly. However, when I try to access the user details, I get an "Active X Cannot Create Component" error. Does any body have any idea why??
Code:
Public Function GetUserDetails(ByVal UserID As String) As Boolean
Dim ADSIObject As New ActiveDs.WinNTSystemInfo()
Dim ADSIUser As ActiveDs.IADsUser
Dim Domain As String
Dim PDC As String
Domain = ADSIObject.DomainName
PDC = ADSIObject.PDC
Dim User As ActiveDs.IADsUser = GetObject("WINNT://" & _
Domain & "/" & UserID & ",User")
MessageBox.Show(User.HomeDirectory)
End Function
The code fails at the line in bold.