Access database won't open

F

Frank Hayward

Hello.

I have created a database connection to an access database in my web
application. The problem is that I get the following error message, even
though nobody is connected to the database. I have tried a fresh boot,
downloading the latest Jet drivers, disabling the sql server, and moving the
database from c:\inetpub\wwwroot\web... to a spot on my hardrive, but none
of these has worked. I am following an exercise from a book so there is no
chance that I have made a coding error. I have also checked all permissions
and doubt that is the problem.

Please help

Thanks Frank
Server Error in '/web/DataWebTrial' Application.
----------------------------------------------------------------------------
----

The Microsoft Jet database engine cannot open the file 'E:\Documents and
Settings\Frank\My Documents\Visual Studio Projects\DataWebTrial\Data.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 'E:\Documents and Settings\Frank\My
Documents\Visual Studio Projects\DataWebTrial\Data.mdb'. It is already
opened exclusively by another user, or you need permission to view its data.

Source Error:


Line 116: Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnLoad.Click
Line 117: DsEmployee1.Clear()
Line 118: OleDbDataAdapter1.Fill(DsEmployee1)
Line 119: End Sub
Line 120:



Source File: c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb Line:
118

Stack Trace:


[OleDbException (0x80004005): The Microsoft Jet database engine cannot open
the file 'E:\Documents and Settings\Frank\My Documents\Visual Studio
Projects\DataWebTrial\Data.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)
DataWebTrial.WebForm1.btnLoad_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb:118
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
 
M

Mary Chipman

When you attempt to connect to an Access mdb from asp.net, you are not
connecting with *your* permissions on the file system, but with those
of the ASP.NET Machine Account (ASPNET). This is a restricted account
and is determined by the <processModel> section in the Machine.config
file. It affects all ASP.NET applications running on the server by
sandboxing them so that they do not have administrative file access on
the host box. Grant the necessary ACLs to ASPNET on the folders
containing the mdb and mdw files (read, write, delete so the .ldb
files get cleaned up).

--Mary

Hello.

I have created a database connection to an access database in my web
application. The problem is that I get the following error message, even
though nobody is connected to the database. I have tried a fresh boot,
downloading the latest Jet drivers, disabling the sql server, and moving the
database from c:\inetpub\wwwroot\web... to a spot on my hardrive, but none
of these has worked. I am following an exercise from a book so there is no
chance that I have made a coding error. I have also checked all permissions
and doubt that is the problem.

Please help

Thanks Frank
Server Error in '/web/DataWebTrial' Application.
----------------------------------------------------------------------------
----

The Microsoft Jet database engine cannot open the file 'E:\Documents and
Settings\Frank\My Documents\Visual Studio Projects\DataWebTrial\Data.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 'E:\Documents and Settings\Frank\My
Documents\Visual Studio Projects\DataWebTrial\Data.mdb'. It is already
opened exclusively by another user, or you need permission to view its data.

Source Error:


Line 116: Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnLoad.Click
Line 117: DsEmployee1.Clear()
Line 118: OleDbDataAdapter1.Fill(DsEmployee1)
Line 119: End Sub
Line 120:



Source File: c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb Line:
118

Stack Trace:


[OleDbException (0x80004005): The Microsoft Jet database engine cannot open
the file 'E:\Documents and Settings\Frank\My Documents\Visual Studio
Projects\DataWebTrial\Data.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)
DataWebTrial.WebForm1.btnLoad_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb:118
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()






----------------------------------------------------------------------------
 
C

CodeDevil

I met a problem like that once.

Try closing access and then try to connect to it from your code. If
that doesn't work email me.


got a code problem? hand it to the devil.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top