Click to See Complete Forum and Search --> : Server Error


juzmorons
July 10th, 2003, 04:13 AM
Server Error in '/omg' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\lhz\Desktop\db1.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\lhz\Desktop\db1.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

Source Error:


Line 29: {
Line 30: // Put user code to initialize the page here
Line 31: oleDbDataAdapter1.Fill(dataSet11);
Line 32: DataGrid1.DataBind();
Line 33:


Source File: c:\inetpub\wwwroot\omg\webform1.aspx.cs Line: 31

Stack Trace:


[OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\lhz\Desktop\db1.mdb'. It is already opened exclusively by another user, or you need permission to view its data.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
omg.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\omg\webform1.aspx.cs:31
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


I've encounted the above problem. Can anyone help solve it? Help appreciated.:confused:

coolbiz
July 10th, 2003, 07:15 AM
ASPNET user on the computer where the web server is running needs MODIFY access to the folder where the DB is located.

-Cool Bizs

mahesh18
July 23rd, 2003, 01:48 AM
hi coolbiz,
can you please explain the steps to give the previleges on both the system where IIS running and where the database is located.
I got the same problem but in my case IIS is one system and mdb is on another.
If both are on the same system then it works fine. please explain the steps for giving permissions to IIS and the mdb file or the folder containing the mdb file.
Thanx in advance.

Regards
Mahesh

coolbiz
July 23rd, 2003, 07:20 AM
Hi,

As I mentioned above, the process that runs the ASP.NET engine runs under the local ASPNET user (if the Web Server is part of Domain Controllers - then the account is the domain ASPNET user).

I've just found out last nite (the hard way) that this is only true if you're running IIS v5 and below. If your web server is on Window .NET 2003 (IIS v6), the process runs under a user called Network Service.

So in order for you to access any resources, be it local or remote, that user must have access to it.

This is assuming that you have not changed the PROCESSMODEL configuration of your ASP.NET engine (look for that keyword in your MACHINE.CONFIG file) or your IDENTITY configuration in your WEB.CONFIG file.

Good Luck,
-Cool Bizs

mahesh18
July 23rd, 2003, 08:35 AM
Hi,
Basically i want to know how to give permissions for the IIS and the folder on the remote system containing the database(mdb file).
After searching in net i think it is related to the IUSER_MACHINE permissions. But even i tried for that also.
Might i was not currect so please give me the steps to give the permissions to both the IIS and the database folder.

Regards
Mahesh

coolbiz
July 23rd, 2003, 09:21 AM
Not the IUSR_<computername> user. ASP.NET runs under a user called ASPNET (look in your USER MANAGER and you'll find this) if you're running IIS v5 and below. If you're running IIS v6, then it runs under NETWORK SERVICE user.

There are 2 types of permissions when dealing with SHARED FOLDER. The first one is SHARED PERMISSION (this can be found on the SHARING tab of the folder properties) and the other one is the FOLDER/FILE PERMISSION which can be found on the SECURITY tab of the folder properties.

It would be really hard for me to explain how you should setup the permission since I don't have all the information needed. If you have a network admin there, you should be able to get help from that person (if you're doing it at home, then PM me so that we can discuss it more).

Good Luck,
-Cool Bizs