473,545 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The dread COMException (0x80004005): Unspecified error...

Well, the problem I'am having now applies to web applications only.
Therefore, I believe it has something to do with security settings. Here's
the code:

-------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim child As System.Director yServices.Direc toryEntry

' dirEntry is a DirectoryEntry component that points to
' WinNT://someserver
' I tried to retrieve the current user Active Directory information by
' using the Find function and specifying the logon userId and which
' schema the user belongs to. In this case, "User"...

child = dirEntry.Childr en.Find(getCurr entUserId, "User")

' lb is a ListBox

lb.DataSource = child.Propertie s()
End Sub

Public Function getCurrentUserI d() As String

' I attempt to retrieve the current user windows logon id with the
' domain name removed using a Spilt("/") but it returns an empty
' string instead

Return
System.Security .Principal.Wind owsIdentity.Get Current.Name.Sp ilt("/")(1)
End Function
-------------------------------------------------------------------

After launching the site, the following error occurs:

-------------------------------------------------------------------
[COMException (0x80004005): Unspecified error
]
System.Director yServices.Inter op.IAdsContaine r.GetObject(Str ing
className, String relativeName) +0
System.Director yServices.Direc toryEntries.Fin d(String name, String
schemaClassName )
ADSearch.WebFor m1.Page_Load(Ob ject sender, EventArgs e) in c:\inetpub\
wwwroot\ADSearc h\WebForm1.aspx .vb:36
System.Web.UI.C ontrol.OnLoad(E ventArgs e)
System.Web.UI.C ontrol.LoadRecu rsive()
System.Web.UI.P age.ProcessRequ estMain()
-------------------------------------------------------------------

I've tried using only the windows logon userId(dirEntry .Children.Find
(getCurrentUser Id)) to retrieve the Active Directory entry for the current
user but the error still comes back.

I'am at my wits end...
solutions anyone?

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
2 4970

The user under which your application is running (most likely
IUSR_SERVERNAME ) might not have permissions to access AD.
You should configure the virtual directory's security to run under a user
that has permissions to do so. Simply create a separate account for it in AD
and use it as the anonymous user (in IIS properties).
Alternatively, you can use ASP.NET impersonation configurable in web.config
(search MSDN for it).

Try doing the same AD stuff from a winforms application, and see if it's
indeed the problem with permissions.

-Oleg.

"Shihao Png via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:2a******** *************** *******@DotNetM onster.com...
Well, the problem I'am having now applies to web applications only.
Therefore, I believe it has something to do with security settings. Here's
the code:

-------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim child As System.Director yServices.Direc toryEntry

' dirEntry is a DirectoryEntry component that points to
' WinNT://someserver
' I tried to retrieve the current user Active Directory information by
' using the Find function and specifying the logon userId and which
' schema the user belongs to. In this case, "User"...

child = dirEntry.Childr en.Find(getCurr entUserId, "User")

' lb is a ListBox

lb.DataSource = child.Propertie s()
End Sub

Public Function getCurrentUserI d() As String

' I attempt to retrieve the current user windows logon id with the
' domain name removed using a Spilt("/") but it returns an empty
' string instead

Return
System.Security .Principal.Wind owsIdentity.Get Current.Name.Sp ilt("/")(1)
End Function
-------------------------------------------------------------------

After launching the site, the following error occurs:

-------------------------------------------------------------------
[COMException (0x80004005): Unspecified error
]
System.Director yServices.Inter op.IAdsContaine r.GetObject(Str ing
className, String relativeName) +0
System.Director yServices.Direc toryEntries.Fin d(String name, String
schemaClassName )
ADSearch.WebFor m1.Page_Load(Ob ject sender, EventArgs e) in c:\inetpub\
wwwroot\ADSearc h\WebForm1.aspx .vb:36
System.Web.UI.C ontrol.OnLoad(E ventArgs e)
System.Web.UI.C ontrol.LoadRecu rsive()
System.Web.UI.P age.ProcessRequ estMain()
-------------------------------------------------------------------

I've tried using only the windows logon userId(dirEntry .Children.Find
(getCurrentUser Id)) to retrieve the Active Directory entry for the current
user but the error still comes back.

I'am at my wits end...
solutions anyone?

--
Message posted via http://www.dotnetmonster.com

Nov 19 '05 #2
Sorry but I don't really get what you mean...do you mean that the user
account that I run on when I attempt to search AD do not have the
permission to do so by the AD server? So that means I should configure AD
so that it allows searching by my user account? Is that what you mean?

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
57663
by: rOadhOg | last post by:
Help please! I set up a simple access 2000 database and I'm running IIS5. The first time I try it, it works, then it seems like I have to wait for some kind of time out for it to work again, because if I click the link that goes to the page again I get this error... Error Type: Provider (0x80004005) Unspecified error
5
3110
by: khan | last post by:
Error Type: CreateRecordset (0x80004005) Unspecified error /finalsite/SearchResults.asp, line 47 this is my code can any one help plz why I am getting ths error <html> <head>
2
2645
by: Jim Lacenski | last post by:
I have a VB class that uses .NET and ADODB to write into an Excel spreadsheet (via Jet) on a server as part of a web application. ADODB is used instead of ADO.NET because it greatly simplifies the write process, and is supported for use on a server. (Excel is not supported (1), licensing issues with OWC). The routine works fine for a user at...
2
4662
by: Bassel Tabbara | last post by:
I wrote the following code: oApp = new Outlook.Application(); oApp = new Outlook.Application(); oNameSpace= oApp.GetNamespace("MAPI"); oNameSpace.Logon(null,null,true,true); //gets defaultfolder for my Outlook Outbox oOutboxFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox); But it won't work and it is giving...
7
22835
by: Jim McGivney | last post by:
ASPX page from VS.net-C# on host's computer using oleDataAdaptor to connect to Microsoft Access database. The page loads, but when connection to the database is attempted to fill a datagrid the following error is generated. Any help would be appreciated. Thanks, Jim Description: An unhandled exception occurred during the execution of the...
0
3861
by: mamin | last post by:
Hi! While running my asp application under Windows 2000 the following error appears: Microsoft JET Database Engine (0x80004005) Unspecified error I've installed MS Jet 4.0 SP1 and MDAC 2.8 SP1 but the problem still exists. As I know it could be the problem with permission, but I'm not sure what permission should I add to folder with my...
4
5316
by: dynastar | last post by:
I'm trying to send custom COMExceptions from my C# server. My test client in C# has no problem reading the HRESULT I send (say, 0x80040002). Needless to say, the MFC client in C++ allows this HRESULT only to the .tli file, which I assume is part of the client. The next thing that happens, it is converted to an SEHException with a value of...
2
2162
by: javediq143 | last post by:
Hi all, I set up a simple access database.Earlier my ASP page was working fine,but dont know whats gone wrong that it started to give me this Err: Error Type: Provider (0x80004005) Unspecified error /imagine/TestJobShow.asp, line 38(This line is "objDbConn.Open") But more problmatic is, sometime it works and sometime not. Plz anybody can...
2
4211
by: kanman | last post by:
hi all. im developing a web based application using asp.net i'm getting this error below: and idea on where the problem is and how to fix? thank you in advance Kanman
0
7457
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7391
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7410
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5320
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4941
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1869
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1010
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.